Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
courses:cs211:winter2018:journals:cantrella:chapter_2 [2018/01/28 20:40] cantrellacourses:cs211:winter2018:journals:cantrella:chapter_2 [2018/01/29 00:32] (current) – [Section 2.5] cantrella
Line 27: Line 27:
 The one algorithm runtime I have always struggled with the most has been O(//n//log//n//). Reading this chapter helped me garner a much better understanding of why this seemingly strange runtime arises so often and how it is implemented in different settings. The one algorithm runtime I have always struggled with the most has been O(//n//log//n//). Reading this chapter helped me garner a much better understanding of why this seemingly strange runtime arises so often and how it is implemented in different settings.
  
-I would give this section a on the interesting scale and a on the readability scale.+I would give this section a on the interesting scale and an 8 on the readability scale. 
 +===== Section 2.5 ===== 
 +Section 2.5 introduces the first truly complex data structure, the priority queue. A priority queue is container type that organizes elements based on their size. When values are pulled from the queue, they are taken based on their priority. Lower values have higher priority. The actual data structure that implements said priority queue is called a heap. A heap can be visualized as a kind of binary array, in which every node has one parent and two children, and the parent node is always greater than both child nodes. 
 + 
 +The advantages of a heap are that it can add and remove elements in O(log//n//) time, making it more efficient than both lists and arrays. It does this by utilizing the heapify-up and heapify-down functions, both of which we covered in class. 
 + 
 +This chapter helped to reinforce my understanding of priority queues and their heap-like implementation. I am curious if a priorit queue could be implemented using a different kind of data structure.  
 + 
 +I give this chapter a 7 on the interesting scale and 7 on the readability scale.
courses/cs211/winter2018/journals/cantrella/chapter_2.1517172028.txt.gz · Last modified: by cantrella
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0