📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    Huffman Coding uses a greedy approach to achieve

    what?
    A Shortest path in a graph. Correct Answer Incorrect Answer
    B Optimal prefix codes for data compression. Correct Answer Incorrect Answer
    C Maximum flow in a network. Correct Answer Incorrect Answer
    D Solving the 0/1 Knapsack problem. Correct Answer Incorrect Answer
    E Finding all pairs shortest paths. Correct Answer Incorrect Answer

    Solution

    Huffman Coding is a greedy algorithm that constructs an optimal prefix code (a type of variable-length code) for a given set of characters based on their frequencies. It repeatedly merges the two nodes with the smallest frequencies until a single tree is formed, resulting in the most efficient compression.

    Practice Next
    ask-question