Question

40. Consider the following tree: 48 29 81 14 37 67 88 17 55 85 97 N Figure 7 a) (1 mark) What is the height of this tree? b)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) What is the height of this tree?

Answer: the height of this tree is 3. Because Total number of edges that lies on the longest path from any leaf node to a particular node is called as height of that node. Height of a tree is the height of root node.

b) What is the level of the node containing “17”?

Answer: The level of the node containing “17” is 3. Each step from top to bottom is called as level of a tree. The level count starts with 0 and increments by 1 at each level or step.

c) What is the value contained in this tree’s root node?

Answer: The value contained in this tree’s root node is 48.

d) What are the ancestors of the node containing “81”?

Answer: the ancestors of the node containing “81” is only 48.

e) How many leaf nodes are contained in this tree?

Answer: 6 lead nodes are contained in this tree and these are 2, 17, 37, 55, 85 and 97.

f) What is the degree of the node containing “67”?

Answer: the degree of the node containing “67” is 1 because it has only one child node that is 55.

g) What is the degree of this tree?

Answer: the degree of this tree is 2 because Degree of a tree is the highest degree of a node among all the nodes in the tree.

h) Trace out the pre order traversal of this tree.  

Answer: Pre order traversal (Root, Left and Right). The pre order traversal of this tree is 48, 29, 14, 2, 17, 37, 81, 67, 55, 88, 85 and 97.

i) Trace out the in order traversal of this tree.  

Answer: In order traversal (Left, Root and Right). The in order traversal of this tree is 2, 14, 17, 29, 37, 48, 55, 67, 81, 85, 88 and 97.

j) Trace out the post order traversal of this tree.  

Answer: Post order traversal (Left, Right and Root). The post order traversal of this tree is 2, 17, 14, 37, 29, 55, 67, 85, 97, 88, 81 and 48.

k) Trace out the level order traversal of this tree.  

Answer: level order traversal (print the same level node from root to leaf). The level order traversal of this tree is 48, 29, 81, 14, 37, 67, 88, 2, 17, 55, 85, and 97.

Add a comment
Know the answer?
Add Answer to:
40. Consider the following tree: 48 29 81 14 37 67 88 17 55 85 97...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider the AVL Tree built by inserting the following sequence of integers, one at a time:...

    Consider the AVL Tree built by inserting the following sequence of integers, one at a time: 5, 2, 8, 7,9 Then we insert 11. After we insert 11, before we perform any necessary rotations, is the tree balanced? And if not, which is the root of the lowest imbalanced subtree? (a) None, since the tree is already balanced after inserting 11. (b) The node containing 5. (c) The node containing 8. (d) The node containing 11. (e) The node containing...

  • Question 8 Consider the tree below. What is the value stored in the parent node of...

    Question 8 Consider the tree below. What is the value stored in the parent node of the node containing 30? Question 8 options: 10 11 14 40 None of the above Question 9 Consider the tree below. How many descendants does the root have? Question 9 options: 0 2 4 8 Question 10 Consider the tree below. What is the depth of the tree? Question 10 options: 2 3 4 8 9 Question 11 Consider the tree below. How many...

  • Attention!!!!!!! I need python method!!!!!!!!! the part which need to edit is below: i nee...

    attention!!!!!!! I need python method!!!!!!!!! the part which need to edit is below: i need python one!!!!!!!!! the part below is interface for the range search tree which don’t need to modify it. Week 3: Working with a BST TODO: Implement a Binary Search Tree (Class Name: RangesizeTree) Choose one language fromJava or Python. Iin both languages,there is an empty main function in the Range Size Tree file. The main function is not tested, however, it is provided for you...

  • Please use C++ as a Programming language and do the tasks specified per the Guideline above...

    Please use C++ as a Programming language and do the tasks specified per the Guideline above and include comments of your work. Please make sure that the following test cases are working: Example 1 For input D13 D60 D76 D12 A17 D98 A94 D70 D3 A23 A42 D45 A100 D50 A99 A22 A87 A4 A90 D88 A71 A20 D39 D83 A97 A56 D28 A9 D43 A19 D5 A11 A54 A73 D54 A9 A24 A58 D6 D80 A72 A47 A82 A12...

  • BIOL 1620o, Spring 2019 NAME (Last, Preferred First): Date: 45. What is the most important means by which capillay exchange occurs? 53. Which of the following organs does NOT contain lymphatic...

    BIOL 1620o, Spring 2019 NAME (Last, Preferred First): Date: 45. What is the most important means by which capillay exchange occurs? 53. Which of the following organs does NOT contain lymphatic tissue? A. liver B. spleen C. lingual tonsils A. exocytosis B. diffusiorn C. ATP powered pumps D. facilitated diffusion E. pharyngeal tonsils. 46.According to Poiseuille's law A. blood flow is not related to resistance. B. ph of the blood influences flow C. viscosity of the blood is not related...

  •   1. When it comes to financial matters, the views of Aristotle can be stated as:...

      1. When it comes to financial matters, the views of Aristotle can be stated as: a. usury is nature’s way of helping each other. b. the fact that money is barren makes it the ideal medium of exchange. c. charging interest is immoral because money is not productive. d. when you lend money, it grows more money. e. interest is too high if it can’t be paid back.  2. Since 2008, when the monetary base was about $800 billion,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT