Question: Answer The Following Multiple Choice Questions And Choose the Correct Answer (A-D). Question 1: Which one of the following statements is true for any tree?
Answer The Following Multiple Choice Questions And Choose the Correct Answer (A-D).
Question 1:
Which one of the following statements is true for any tree?
Question 1 options:
| A. | the root node has no parent node |
| B. | the root node has no data value |
| C. | the root node has no child nodes |
| D. | the root node has no edges |
Question 2:
Which one of the following statements is true for any tree (not just binary trees)?
Question 2 options:
| A. | each leaf node has no parent node |
| B. | each leaf node has no data value |
| C. | each leaf node has no child nodes |
| D. | each leaf node has more than one edge |
Question 3:
Which one of the following statements is true for any tree?
Question 3 options:
| A. | there may be more than one path from the root node to some of the leaf nodes |
| B. | there is more than one path from the root node to every leaf node |
| C. | there is a path from the root node to only some of the leaf nodes |
| D. | there is exactly one path from the root node to every leaf node |
Question 4:
Bitcoin is a digital cash system where a log of all transactions ever made is stored as a (very large) tree data structure. Each node in the tree represents a transaction, with details of the amount of money involved and the source and destination accounts.
Each node also contains a hash of the contents of its parent node (the most recent transaction before it), to prevent transaction records from being changed later. To verify that nothing has been changed, you start at a leaf node and work towards the root one node at a time, checking that the hashes are correct as you go.
Assume that computing the hash is an O(1) operation. What is the time complexity of verifying the complete history of a Bitcoin transaction?
Question 4 options:
| A. | O(1) |
| B. | O(log N) where N is the height of the tree |
| C. | O(N) where N is the height of the tree |
| D. | O(N log N) where N is the height of the tree |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
