二进制树和二进制搜索树之间的区别 [英] Difference between binary tree and binary search tree

查看:189
本文介绍了二进制树和二进制搜索树之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以举例说明二叉树二叉搜索树 之间的区别吗?

Can anyone please explain the difference between binary tree and binary search tree with an example?

推荐答案

二叉树:每个节点最多有两片叶子的树

Binary tree: Tree where each node has up to two leaves

  1
 / \
2   3


二分搜索树:用于搜索.一棵二叉树,其中左子节点包含的 only 节点的值小于父节点,而右子节点 only 的节点包含的值大于或等于父节点.


Binary search tree: Used for searching. A binary tree where the left child contains only nodes with values less than the parent node, and where the right child only contains nodes with values greater than or equal to the parent.

  2
 / \
1   3

这篇关于二进制树和二进制搜索树之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆