#NEWLINE# def test_decrease_key( self ) : #NEWLINE# #INDENT# nodes = [ ] #NEWLINE# maxKey = None #NEWLINE# maxNode = None #NEWLINE# H = FiboHeap ( ) #NEWLINE# random . seed ( ) #NEWLINE# for d in range ( 10000 ) : #NEWLINE# #INDENT# n = random . randint ( 1 , 100000 ) #NEWLINE# if ( ( maxNode == None ) or ( n > maxNode ) ) : #NEWLINE# #INDENT# maxKey = n #NEWLINE# maxNode = H . insert ( n , n ) #NEWLINE# nodes . append ( n ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# nodes . append ( n ) #NEWLINE# H . insert ( self , n ) #NEWLINE# #UNINDENT# #UNINDENT# H . decrease_key ( maxNode , H . get_min_key ( ) ) #NEWLINE# self . assertEqual ( H . get_node_key ( maxNode ) , H . get_min_key ( ) )