Hash Tree Multiple Choice Questions and Answers (MCQs)

«
»

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Hash Tree”.

1. Hash tree is generalization of ______
a) Heap
b) Hash list
c) BST
d) B – tree
View Answer

Answer: b
Explanation: Hash list is the list of hashes of the blocks in a set file. Hash tree is a generalization of the hash list in which leaves are labeled with the hash of a data block and every non-leaf node is hash of the labels of its children.
advertisement

2. Hash tree is used in effective data verification in distributed systems.
a) True
b) False
View Answer

Answer: a
Explanation: Hash trees are used in distributed systems for efficient data verification. Hash tree used hashes instead of the full files, hence they are efficient. Because Hashes are ways of encoding files that are much smaller than the actual file itself.

3. Which of the following is a widely used form of the hash tree?
a) B+ – tree
b) T tree
c) Tiger tree hash
d) Htree
View Answer

Answer: c
Explanation: The general form the hash tree which is used widely is the Tiger tree hash. It uses a binary hash tree, usually has a data block size of 1024 bytes and uses the Tiger hash.

4. Which of the following is true for a Hash tree?
a) Hashing is used for sequential access
b) Indexing is used for direct access
c) Hash tree allows only sequential access
d) Hashing is used for direct access
View Answer

Answer: d
Explanation: Hash tree allows direct as well as sequential access of the records. Hashing is used for direct access and indexing is generally used for the sequential access.

5. Hash tree is also known as _____
a) Merkle tree
b) T -tree
c) Hash table
d) Bx-tree
View Answer

Answer: a
Explanation: Hash tree is generally known as Merkle tree after Ralph Merkle who patented it in 1979. Typically Merkle trees have a branching factor of 2, meaning that each node has up to 2 children.
advertisement

6. What will be the height of the hash tree with branching factor 2 and with 8 records?
a) 3
b) 5
c) 4
d) 6
View Answer

Answer: c
Explanation: Consider 8 records A B C D E F G H. These records are stored in Hash tree in as shown in figure below.
hash-tree-questions-answers-q6

7. Where is the hash tree used?
a) in digital currency
b) in sorting of large data
c) for indexing in databases
d) in encryption of data
View Answer

Answer: a
Explanation: Using Hash tree the data verification, data synchronisation and the consistency verification can be done efficiently. So, the hash tree are digital currencies to organise the transactions.

8. What is the worst case time complexity of the insertion in the hash tree?
a) O(logk(n))
b) O(n2)
c) O(nlogk(n))
d) O(kn)
View Answer

Answer: a
Explanation: To insert a record in the hash tree the key is compressed and hashed to get the slot for the entry. So, a hash tree with branching factor k takes O(logk(n)) for insertion in worst case.

9. Sequential access in a Hash tree is faster than in B-trees.
a) True
b) False
View Answer

Answer: a
Explanation: The sequential access in the hash tree is more efficient and faster than in B-tree. Because while constructing the hash tree in the expansions and contractions of the file is an estimated.
advertisement

10. Hash tree is used in data synchronisation. In the worst case the data synchronisation takes ______ time.
a) O(logn)
b) O(n2)
c) O(nlogn)
d) O(n)
View Answer

Answer: d
Explanation: In average scenarios, the synchronisation takes O(logn) because it is based on the traversal and searching. The worst case occurs when there are no nodes in common, so the synchronisation takes O(n) time.

Sanfoundry Global Education & Learning Series – Data Structure.

To practice all areas of Data Structure, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn