CS 240 Lecture Notes - Lecture 8: Problem Set, Binary Search Tree, Priority Queue
Document Summary
You have 50 job offers but once you go to them physically you will need to make your decision. We have the scores for each company as 8, 4, 9, 2: array, we do not have to put it in sorted order but then we need to take o(n) If we store with an array we will need to constantly reallocate. operation where we need to find the right value. Array is not the best implementation for this: list, sorting is a little bit easier. We can just traverse through find the spot. We need to be able to solve that things have to go into a certain place is called strict ordering. We need to keep this tree balanced for a priority queue. Balanced tree: no leaf node is more than one level away from any other leaf node. Full tree: no internal node has a single child.