Doubt in options

Q3. Huffman 4
What is the time complexity of Huffman Coding?

O (N)

O (NlogN)

O (N (log N)^2)

O (N^2)

shouldnt option b and c both be corect?

@Akshita99 complexity of huffman coding is nlogn just google
one of the ref (https://www.geeksforgeeks.org/huffman-coding-greedy-algo-3/)
dont forget to hit like and mark resolved if cleared :smiley:

yeah but min-heapify is called 2n times so it’s complexity is 2logn i.e. logn^2. same que is present in quiz 2 of greedy algos too and there answer is given as nlogn^2

@Akshita99
2nlogn=nlog(n^2)
but option is n(logn)^2
there’s a difference

okay got it .