Skip to content

AttributeError: 'NoneType' object has no attribute 'data' #4

Open
@mshishvan

Description

@mshishvan

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.)

https://repl.it/Bouq/13

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions