简单二叉搜索树是二叉搜索树的简单实现

simplebst的Python项目详细描述


https://badge.fury.io/py/simplebst.pnghttps://travis-ci.org/drincruz/simplebst.png?branch=masterhttps://pypip.in/d/simplebst/badge.png

简单二进制搜索树是二进制搜索树的简单实现

功能

To use Simple Binary Search Tree in a project:

# At minimal, you'll need to import simplebst.Node
from simplebst import Node

# Create a single element tree with value of 23
# Its left and right sub-trees are set to None
tree = Node(23)

Get the value of a Node:

tree.get_value()

Get the left/right child Node of a Node:

tree.get_left()
tree.get_right()

Insert a new node into the tree:

# Import simplebst.utils.insert_node
from simplebst.utils import insert_node

# Insert a node will modify the tree you specify
# So, we'll use our previous example of "tree"
insert_node(tree, 17)

# If you were curious you should see the correct
# value if you do the following
tree.get_left().get_value()

# Let's fill the tree with values
for value in [18, 27, 53, 11]:
    insert_node(tree, value)

For more detailed usage, please see the usage documentation: https://simplebst.readthedocs.org/en/latest/usage.html

历史记录

0.1.0(2014-09-11)

  • github上的第一个版本。

0.2.0(2014-09-19)

  • 代码清理和更新的实用程序和遍历

0.3.0(2014-10-08)

  • 添加了以下遍历:
    • 预订
    • 下单后
    • 水平顺序

0.4.0(2014-10-16)

  • 添加了tree_height()util
  • 添加了我之前错过的insert_node()单元测试(是的,代码覆盖率!)

0.4.1(2014-10-22)

  • 更新setup.py以支持nose作为其测试套件,以便`python setup.py test`可以成功运行。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
ArrayList中实体对象上的JAVA泛型   带Redis的爪哇芹菜vs单用Redis   java在设备面向横向时隐藏标题栏/通知栏   java JXTreeTable:如何使用ComponentProvider为一列设置渲染器   java创建异常的成本与记录异常的成本相比   java在方法参数中使用setter传递新对象   java在一个类中的方法与另一个类中的方法交互时遇到问题   java如何迭代2个大小相等的ArrayList   Java getDesktop()。open在Windows中工作,但在Mac中不工作   从tomcat切换到jetty后的java“无法启动嵌入式容器”,Spring引导   java如何使用void方法   java如何在解组时在JAXB的ValidationEventHandler中获取节点值?   如何使用Akka Java API创建不响应的TCP接收器   JavaScriptjQuery在java中将记录上传到数据库时的进度条   如何在重新绘制时在java小程序中显示上一个图像