Created required brackets in logn (#33401)

pull/32947/head^2
25Harry 2019-05-13 03:28:05 +05:30 committed by Randell Dawson
parent 1a4d7a04ac
commit 3e404cd075
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ Properties of B-Tree:
5) Number of children of a node is equal to the number of keys in it plus 1.
6) All keys of a node are sorted in increasing order. The child between two keys k1 and k2 contains all keys in range from k1 and k2.
7) B-Tree grows and shrinks from root which is unlike Binary Search Tree. Binary Search Trees grow downward and also shrink from downward.
8) Like other balanced Binary Search Trees, time complexity to search, insert and delete is O(Logn).
8) Like other balanced Binary Search Trees, time complexity to search, insert and delete is O(Log(n)).
Search:
Search is similar to search in Binary Search Tree. Let the key to be searched be k. We start from root and recursively traverse down. For every visited non-leaf node, if the node has key, we simply return the node. Otherwise we recur down to the appropriate child (the child which is just before the first greater key) of the node. If we reach a leaf node and dont find k in the leaf node, we return NULL.