Close
Register
Close Window

DSA Coursenotes

Chapter 5 Week 6

Show Source |    | About   «  4.4. Comparison   ::   Contents   ::   5.2. Huffman Coding  »

5.1. Heaps

5.1.1. Heaps

5.1.1.1. Complete Trees

Complete binary tree node numbering
\[\begin{split}\begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline \textrm{Position} & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11\\ \hline \hline \textrm{Parent} & \,--\, & 0 & 0 & 1 & 1 & 2 & 2 & 3 & 3 & 4 & 4 & 5\\ \hline \textrm{Left Child} & 1 & 3 & 5 & 7 & 9 & 11 & \,--\, & \,--\, & \,--\, & \,--\, & \,--\, & \,--\,\\ \hline \textrm{Right Child} & 2 & 4 & 6 & 8 & 10 & \,--\, & \,--\, & \,--\, & \,--\, & \,--\, & \,--\, & \,--\,\\ \hline \textrm{Left Sibling} & \,--\, & \,--\, & 1 & \,--\, & 3 & \,--\, & 5 & \,--\, & 7 & \,--\, & 9 & \,--\,\\ \hline \textrm{Right Sibling} & \,--\, & 2 & \,--\, & 4 & \,--\, & 6 & \,--\, & 8 & \,--\, & 10 & \,--\, & \,--\,\\ \hline \end{array}\end{split}\]

5.1.1.2. Heap insert

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

5.1.1.3. Building a Heap

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

5.1.1.4. Building a Heap Proof

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

5.1.1.5. Delete the maximum value

Settings

Proficient Saving... Error Saving
Server Error
Resubmit

   «  4.4. Comparison   ::   Contents   ::   5.2. Huffman Coding  »

nsf
Close Window