fireblade wrote: > I have implementation of A* using Binary heaps, and as usually > everything is good untill I need to update elemt in the middle > of the heap? > Anybody has a good algorithm of doing this efficiently/ > thanks > bobi
Yes. Google heap sift up down The sift up and down operations can be used to reposition a node correctly in the tree after its key has been changed. Alternately you can delete the node containing the old value and insert the new one. The Big O time complexity will be the same, but the custom sift up/down solution will have a better constant factor. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---