What is the sorting problem?
What is a priority queue?
What are the 4 fundamental methods performed on a priority queue
what order are elements stored in in priority queues?
How is a deletion completed in a priority queue and what is the time complexity of this?
How can we use a priority queue to perform sorting on a set of elements in two phases?
Describe the primary queue sorting algorithm
What is the running time of the priority queue sorting algorithm?
O(nlog) because there’s technically 2nlogn since putting n elements in PQ then searching logn to find where to insert them takes nlogn time, and we do this again n times when we remove every item from the pq to add to a sorted list, hence nlogn, but 2nlogn = O(nlogn)
What is a heap data structure?
What are the properties of a heap data strucutre?
How can we implement a heap data structure?
What is the last used node/element at the bottom level of the binary tree/heap?
The rightmost element/node on the lowest level of the tree
How are items inserted into heaps?
What is the time complexity of insertion into a heap?
At max we’ll need to do 2^n number of swaps where n is the height of the heap, the insertion is only O(1) so the time complexity is log2(n)
How is deletion in a heap carried out?
When bubbling the item at the root node down, how do we decide which subtree’s element to swap with?
What are the time complexities of finding the size/is empty, minElement, minKey, insertItem and removeItem methods for a heap?
What is the divide and conquer method and how is it achieved?
How is a merge sort performed?
What are the 3 steps in the divide and conquer method
What does merging mean in a merge sort
Putting the inputs in global sorted order
What is the time complexity of a merge sort
What are counting inversions?
Having two sets of rankings of numbers, e.g. 1 3, 4, 5, 2 and 1, 2, 4, 3, 5 and counting the number of inversions between the two rankings to give a meaningful metric of the difference in the two rankings
how do we count inversions