二叉树和二叉搜索树的区别 [英] Difference between binary tree and binary search tree

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

问题描述

谁能用一个例子解释二叉树二叉搜索树的区别?

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

<小时>

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


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天全站免登陆