MCPcopy
hub / github.com/keon/algorithms / insert

Method insert

algorithms/data_structures/bst.py:63–68  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

61 """
62
63 def insert(self, data):
64 if self.root:
65 return self.recur_insert(self.root, data)
66 else:
67 self.root = Node(data)
68 return True
69
70 def recur_insert(self, root, data):
71 if root.data == data: # The data is already there

Callers 13

setUpMethod · 0.45
test_insertMethod · 0.45
reconstruct_queueFunction · 0.45
_split_childMethod · 0.45
_rotate_rightMethod · 0.45
setUpMethod · 0.45
pushMethod · 0.45
plus_one_v2Function · 0.45
setUpMethod · 0.45
setUpMethod · 0.45
setUpMethod · 0.45

Calls 2

recur_insertMethod · 0.95
NodeClass · 0.70

Tested by 2

setUpMethod · 0.36
test_insertMethod · 0.36