Page 1 of 1

Assuming that we have an array-based implementation of a heap where the heap’s elements start at position 1, how can we

Posted: Thu May 26, 2022 9:15 am
by answerhappygod
Assuming that we have an array-based implementation of a
heap where the heap’s elements start at position 1, how can we
compute children’s positions for an element stored at position k?
How can we compute a position of a parent element?
Assuming that we have an array-based implementation of a
heap where the heap’s elements start at position 0, how can we
compute children’s positions for an element stored at position k?
How can we compute a position of a parent element?
Briefly explain the idea behind the rise and sink
operations. What is their worst-case complexity?
What is the worst-case complexity of
HeapSort?