Binary Search Tree

来源:互联网 发布:冒险岛boss数据 编辑:程序博客网 时间:2024/05/16 14:38

1. What is Binary Search Tree

A binary search tree(BST) is a binary tree with root value is bigger than all nodes in left sub-tree are smaller than all nodes in right sub-tree, while each sub-tree is also a binary Search Tree.

2. Time complexity

Space O(n)

Search Average O(log n) Worst case O(n)

Insert Average O(log n) Worst case O(n)

Delete Average O(log n) Worst case O(n)


0 0
原创粉丝点击