Repeat steps 3 to 5 for all the characters. Repeat steps 3 to 5 for all the characters.Remove these two minimum frequencies from Q and add the sum into the list of frequencies (* denote the internal nodes in the figure above).Set the value of the z as the sum of the above two minimum frequencies. Assign the minimum frequency to the left child of z and assign the second minimum frequency to the right child of z. Make each unique character as a leaf node. These are stored in a priority queue Q.Ĭharacters sorted according to the frequency
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |