# YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

## Huffman Code Multiple choice Questions and Answers (MCQs)

Question 6 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

In Huffman coding, data in a tree always occur?

roots | |

leaves | |

left sub trees | |

right sub trees |

Question 6 Explanation:

In Huffman encoding, data is always stored at the leaves of a tree inorder to compute the codeword effectively.

Question 7 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

From the following given tree, what is the code word for the character 'a'?

011 | |

10 | |

100 | |

101 |

Question 7 Explanation:

By recording the path of the node from root to leaf, the code word for character 'a' is found to be 011.

Question 8 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

From the following given tree, what is the computed codeword for 'c'?

111 | |

101 | |

110 | |

11 |

Question 8 Explanation:

By recording the path of the node from root to leaf, assigning left branch as 0 and right branch as 1, the codeword for c is 110.

Question 9 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

What will be the cost of the code if character c

_{i}is at depth d_{i}and occurs at frequency f_{i}?c _{i}f_{i} | |

∫c _{i}f_{i} | |

∑f _{i}d_{i} | |

f _{i}d_{i} |

Question 9 Explanation:

If character c

_{i}is at depth d_{i}and occurs at frequency f_{i}, the cost of the codeword obtained is ∑f_{i}d_{i}.Question 10 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

An optimal code will always be present in a full tree.

true | |

false |

Question 10 Explanation:

An optimal tree will always have the property that all nodes are either leaves or have two children. Otherwise, nodes with one child could move up a level.

There are 10 questions to complete.