Podcast
Questions and Answers
What is the time complexity of the insertion-sort algorithm?
What is the time complexity of the insertion-sort algorithm?
O(n^2)
How can insertion-sort be implemented in-place?
How can insertion-sort be implemented in-place?
By using a portion of the input sequence as the priority queue and keeping the initial portion of the sequence sorted, with swaps instead of modifying the sequence.
What is the heap-order property in a heap data structure?
What is the heap-order property in a heap data structure?
For every internal node v, key(v) ≥ key(parent(v)).
What is the complete binary tree property in a heap?
What is the complete binary tree property in a heap?
Signup and view all the answers
What is the time complexity of removing elements from a priority queue in sorted order?
What is the time complexity of removing elements from a priority queue in sorted order?
Signup and view all the answers
What is the adaptable priority queue ADT?
What is the adaptable priority queue ADT?
Signup and view all the answers
How does the height of a heap relate to the number of keys it stores?
How does the height of a heap relate to the number of keys it stores?
Signup and view all the answers
What is the difference between selection-sort and insertion-sort?
What is the difference between selection-sort and insertion-sort?
Signup and view all the answers
What is the purpose of a priority queue ADT?
What is the purpose of a priority queue ADT?
Signup and view all the answers
How can a heap be implemented?
How can a heap be implemented?
Signup and view all the answers