Algorithms – You are using the algorithm given below to create a simple implementation of a Huffman tree…


You are using the algorithm given below to create a simple implementation of a Huffman tree.

loop a = EXTRACTMIN(N);
if N = ∅ then return a endif;
ν = EXTRACTMIN(N);
create node κ with children a and b
and weight w(k) = w(a) + w(b);
add k to N

Analyze the algorithm and predict the worst case running time complexity for the same.


Related Posts

Close Bitnami banner
Bitnami