Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
courses:cs211:winter2011:journals:david:chapter2 [2011/01/25 20:44] – [2.5 - A More Complex Data Structure: Priority Queues] margoliesd | courses:cs211:winter2011:journals:david:chapter2 [2011/01/25 20:53] (current) – [2.5 - A More Complex Data Structure: Priority Queues] margoliesd | ||
---|---|---|---|
Line 21: | Line 21: | ||
====2.5 - A More Complex Data Structure: Priority Queues==== | ====2.5 - A More Complex Data Structure: Priority Queues==== | ||
- | An efficient algorithm can be improved by using a different kind of data structure. In a priority queue, all elements have an associated key or value, and the lower the value, the higher the priority. Operating systems use priority queues to determine which process gets to use the CPU. In a priority queue, an element can be added, deleted, and the highest priority item can be selected in O(logN) time. | + | An efficient algorithm can be improved by using a different kind of data structure. In a priority queue, all elements have an associated key or value, and the lower the value, the higher the priority. Operating systems use priority queues to determine which process gets to use the CPU. In a priority queue, an element can be added, deleted, and the highest priority item can be selected in O(logN) time. Priority queues can be implemented using a heap, which is visually like a " |
+ | |||
+ | I give this section a readability of 7/10. |