@@ -25,19 +25,22 @@ class BinaryTree(object):
2525 Parameters
2626 ==========
2727
28+ key
29+ Required if tree is to be instantiated with
30+ root otherwise not needed.
31+
2832 root_data
2933 Optional, the root node of the binary tree.
3034 If not of type TreeNode, it will consider
3135 root as data and a new root node will
3236 be created.
33- key
34- Required if tree is to be instantiated with
35- root otherwise not needed.
37+
3638 comp: lambda/function
3739 Optional, A lambda function which will be used
3840 for comparison of keys. Should return a
3941 bool value. By default it implements less
4042 than operator.
43+
4144 is_order_statistic: bool
4245 Set it to True, if you want to use the
4346 order statistic features of the tree.
@@ -80,6 +83,7 @@ def insert(self, key, data=None):
8083
8184 key
8285 The key for comparison.
86+
8387 data
8488 The data to be inserted.
8589
@@ -101,6 +105,7 @@ def delete(self, key, **kwargs):
101105 key
102106 The key of the node which is
103107 to be deleted.
108+
104109 balancing_info: bool
105110 Optional, by default, False
106111 The information needed for updating
@@ -135,6 +140,7 @@ def search(self, key, **kwargs):
135140
136141 key
137142 The key for searching.
143+
138144 parent: bool
139145 If true then returns index of the
140146 parent of the node with the passed
@@ -532,8 +538,10 @@ def lowest_common_ancestor(self, j, k, algorithm=1):
532538
533539 j: Node.key
534540 Key of first node
541+
535542 k: Node.key
536543 Key of second node
544+
537545 algorithm: int
538546 The algorithm to be used for computing the
539547 lowest common ancestor.
@@ -1213,13 +1221,14 @@ def breadth_first_search(self, node=None, strategy='queue'):
12131221 Parameters
12141222 ==========
12151223
1216- strategy : str
1217- The strategy using which the computation has to happen.
1218- By default, it is set 'queue'.
12191224 node : int
12201225 The index of the node from where the traversal has to be instantiated.
12211226 By default, set to, root index.
12221227
1228+ strategy : str
1229+ The strategy using which the computation has to happen.
1230+ By default, it is set 'queue'.
1231+
12231232 Returns
12241233 =======
12251234
0 commit comments