updated line 46 in Hashmap, lines 33-34 in 2-3 Tree, per feedback from Xiaochen
This commit is contained in:
@@ -29,8 +29,6 @@ class Node:
|
|||||||
self.child.extend(new_node.child)
|
self.child.extend(new_node.child)
|
||||||
if len(self.child) > 1:
|
if len(self.child) > 1:
|
||||||
self.child.sort()
|
self.child.sort()
|
||||||
for child in self.child:
|
|
||||||
child.parent = self
|
|
||||||
if len(self.data) > 2:
|
if len(self.data) > 2:
|
||||||
self._split()
|
self._split()
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class HashMap:
|
|||||||
if self.map[key_hash][i][0] == key:
|
if self.map[key_hash][i][0] == key:
|
||||||
self.map[key_hash].pop(i)
|
self.map[key_hash].pop(i)
|
||||||
return True
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def print(self):
|
def print(self):
|
||||||
print('---PHONEBOOK----')
|
print('---PHONEBOOK----')
|
||||||
|
|||||||
Reference in New Issue
Block a user