Question: Heap - lexorder

Hi, I need to construct a heap using a list. Have found this in Maple help. > h := (heap[new])(lexorder, greg, tony, bruno, michael); (heap[insert])(stefan, h); stefan > (heap[size])(h); 5 > (heap[max])(h); tony > while `not`((heap[empty])(h)) do (heap[extract])(h) end do; tony stefan michael greg bruno What would be a command similar to 'lexorder' that will enable to arrange numbers in a heap? Also, how would I deconstruct a heap into a list? Is there a command in Maple that would allow to see the worst case scenario (a maximum number of comparison between the elements of the heap) and the best case scenario (a minimum number of comparisons). Thanks in advance! Antonio
Please Wait...