“贾里德”怎么样?大于“布列塔尼”?
我查了一下书,没有解释。它告诉我什么是二叉搜索树,并且它决定使用字符串。
Jared
/ \
Brittany Megan
/ \ / \
Brett Doug Jim Whitney
所以据推测,一个节点大于其左子树,小于其右子树。贾里德比布列塔尼强在哪里?
I'm looking in my book, and it doesn't explain it. Its telling me what a binary search tree is and it decided to use strings.
Jared
/ \
Brittany Megan
/ \ / \
Brett Doug Jim Whitney
So supposedly, a node is greater than its left subtree and lesser than its right subtree. How is Jared greater than Brittany?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在字典中,“Jared”一词出现在“Brittany”之后。
In a dictionary, the word "Jared" would come after "Brittany".
http://en.wikipedia.org/wiki/Lexicographical_order
使用默认的字符串比较规则,具有较大整数代码的字符使字符串“更大”,即“J”>“J”。 'B'。然而现实生活中有很多细微差别:)
Using default string comparison rules, characters with larger integer codes makes string "larger" i.e. 'J' > 'B'. However there is lot of nuances in real life :)