Skip to content

Commit

Permalink
Fixed assumption of root starting with 0 (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aimaanhasan authored Apr 19, 2020
1 parent 4452dc8 commit 8d8e688
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydatastructs/trees/binary_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def insert(self, key, data=None):
self.tree[walk].key = key
self.tree[walk].data = data
return None
new_node, prev_node, flag = TreeNode(key, data), 0, True
new_node, prev_node, flag = TreeNode(key, data), self.root_idx, True
while flag:
if not self.comparator(key, self.tree[walk].key):
if self.tree[walk].right is None:
Expand Down

0 comments on commit 8d8e688

Please sign in to comment.