📝 Pastry applications in P2P (8 MCQs)
📖 From Data Communication and Networks • 29. Peer to Peer Paradigm • 8 questions available
What is Pastry applications in P2P?
Pastry applications in P2P include secure data storage, multicast communication, and location-independent naming, leveraging its deterministic routing and locality awareness to build robust and efficient decentralized services.
📝 All Pastry applications in P2P MCQs
Q1. In a set of symbols with frequencies , , , , and , which two symbols are combined first when building the Huffman tree?
📖 Explanation: The Huffman algorithm always merges the two lowest‑frequency nodes. Here the smallest frequencies are and ; merging them yields a new node of weight . No other pair has a combined weight lower than , so the correct pair is C and E.
Q2. Compared to a fixed‑length code of 3 bits per symbol, which statement correctly describes the average bits per symbol for the Huffman code built from the frequencies in the previous question?
📖 Explanation: Because Huffman coding assigns shorter codes to high‑frequency symbols and longer codes to low‑frequency ones, the weighted average length is always lower than the uniform length of a fixed‑length code when symbol frequencies are non‑uniform. Hence the average bits per symbol is less than 3.
Q3. Given symbols , , and constructing a Huffman tree, which binary code is assigned to symbol ?
📖 Explanation: First, combine the two smallest frequencies and to create a node of weight . This node and are then merged at the root. Assigning 0 to the left branch and 1 to the right, the path to is left‑left, yielding the code .}
Q4. During LZW decoding, if the current codeword does not yet exist in the dictionary, what string should the decoder output?
📖 Explanation: When a codeword is absent, the decoder follows the special rule: output the previous string plus its own first character. This constructs the new entry that will later be added to the dictionary, preserving the algorithm’s consistency.
Q5. If the frequency of a symbol in a Huffman tree is increased, what is the most likely effect on the length of its codeword?
📖 Explanation: Increasing a symbol's frequency makes it more likely to be merged earlier with other low‑frequency nodes, moving it closer to the root. Consequently, the path from root to that leaf shortens, reducing the number of bits required to represent the symbol.
Q6. Which of the following sequences correctly describes the steps to construct a Huffman coding table from a set of symbol frequencies?
📖 Explanation: The proper workflow is: first build the Huffman tree by repeatedly merging the two lowest‑frequency nodes; then traverse the completed tree to assign binary digits to each branch, producing the code for each symbol; finally, compile these codes into a coding table.
Q7. Using the Huffman tree where A=00, B=01, C=10, and D=11, what is the encoded bitstring for the message \ABCA\?
📖 Explanation: Encode each character sequentially: A→00, B→01, C→10, A→00. Concatenating yields 00 01 10 00, i.e., the bitstring \00011000\. Any other arrangement would mismatch the defined codes.
Q8. In an LZW compression example, the decoder outputs \ABAB\ instead of the expected \ABBA\. Which step is most likely the source of the error?
📖 Explanation: When the codeword size is not updated at the correct point, later codewords are read with the wrong number of bits, causing misalignment. This typically leads to the decoder interpreting subsequent codes incorrectly, producing a string like \ABAB\ instead of the intended \ABBA\.