In Huffman coding, which characters are usually assigned shorter codes?

2025

In Huffman coding, which characters are usually assigned shorter codes?

  1. A.

    Characters with higher frequency

  2. B.

    Characters with lower frequency

  3. C.

    Characters with longer ASCII values

  4. D.

    Characters with shorter ASCII values

Attempted by 166 students.

Show answer & explanation

Correct answer: A

Huffman coding is a lossless data compression algorithm that assigns variable-length codes to input characters. The core principle is that characters appearing more frequently in the data are assigned shorter binary codes, while less frequent characters receive longer codes.

This approach minimizes the total number of bits needed to represent the entire message. By prioritizing high-frequency characters with shorter codes, the overall file size is reduced efficiently.

हिन्दी उत्तर:

हफमैन कोडिंग एक हानिरहित डेटा संपीड़न एल्गोरिदम है जो इनपुट वर्णों को चर-लंबाई वाले कोड देता है। इसका मुख्य सिद्धांत यह है कि डेटा में अधिक बार आने वाले वर्णों को छोटे बाइनरी कोड दिए जाते हैं, जबकि कम बार आने वाले वर्णों को लंबे कोड दिए जाते हैं।

यह दृष्टिकोण संदेश को दर्शाने के लिए आवश्यक कुल बिट्स की संख्या को न्यूनतम करता है। उच्च आवृत्ति वाले वर्णों को छोटे कोड प्राथमिकता देकर, कुल फ़ाइल का आकार कुशलता से कम हो जाता है।

Explore the full course: Bpsc