Open
Description
Hi Daniel,
I tried to test the algorithm with some different numbers, I faced the "AttributeError: 'NoneType' object has no attribute 'data'". basically, when you have many same key nodes, this error happens. Do you maybe know why this is happening? (It removes the node from child list other than the rootlist.)
f = FibonacciHeap()
seed(4333)
# insert elements
for i in xrange(0, 1000): #tried to do for 1000 nodes
f.insert(randint(1,500)) #random number between 1-500
# print the root list
print [x.data for x in f.iterate(f.root_list)]
# extract min
while f.total_nodes > 0:
m = f.extract_min()
print 'min is: ' + str(m.data)
Metadata
Metadata
Assignees
Labels
No labels