CS 240 Lecture Notes - Lecture 8: Problem Set, Binary Search Tree, Priority Queue

70 views9 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents