1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lerok [7]
3 years ago
10

Draw the BST where the data value at each node is an integer and the values are entered in the following order 36,22,10,44,42,16

,25,3,23,24 solution

Computers and Technology
1 answer:
Tems11 [23]3 years ago
8 0

Answer and Explanation:

A BST is the short form for Binary Search Tree. It is a special type of binary tree data structure in which nodes are arranged in a particular order such that;

i. the left subtree of a particular node should always contain nodes whose key values are less than that of the key value of the node itself.

ii. the right subtree of a particular node should always contain nodes whose key values are greater than that of the key value of the node itself.

iii. the right and left subtrees should also be a binary search tree.

For the given set of data:

36,22,10,44,42,16,25,3,23,24;

The equivalent binary search tree is attached to this response.

<em>As shown in the attachment:</em>

i. the first data value (36) is the root node value.

ii. the second value (22) is less than the root node value (36), therefore, 22 goes to the left of the root node.

iii. the third value is 10. This is less than 36 and then also less than 22, so 10 goes to the left of 22.

iv. the fourth value is 44. This is greater than the root node value (36), therefore, 44 goes to the right of the root node.

v. the fifth value is 42. This is greater than the root value (36) so it is going to be positioned somewhere at the right of the root node. But it is less than the value (44) of the direct right node of the root node. Therefore, 42 goes to the left of the direct right (44) of the root node.

vi. the sixth value is 16. This is less than the root node value (36). So it is going to be positioned somewhere at the left of the root node. It is also less than the value (22) of the direct left node of the root node. So it is going to be positioned somewhere at the left of the node with 22. But it is greater than the node with 10. Therefore, 16 is going to be to the right of the node with 10.

This trend continues until all data values have been rightly positioned.

<em>PS: A binary tree is a data structure in which each node cannot have more than two nodes directly attached to it.</em>

<em />

You might be interested in
thick is incorrect does anybody know the correct answer? please don’t send any files i can’t open them
77julia77 [94]

Answer:

i think its new

Explanation:

if this is incorrect i apologize

7 0
3 years ago
Is mmorpg an example of virtual community
Inga [223]
Yes I would say it is.
4 0
4 years ago
Read 2 more answers
Which best describes a computer bug?
yanalaym [24]

Answer:

a piece of computer software containing defects that prevent a program from running properly

Explanation:

i got a 100% on the test

6 0
3 years ago
What is a full featured word processing program that allows you to create many types of personal and business document.
miskamm [114]
B) Word is the answer
3 0
4 years ago
Which of the following is not a standard view in Microsoft PowerPoint?
Luda [366]
I think the answer would be D. Sorry if i'm wrong but i'm pretty sure it is D.
6 0
3 years ago
Other questions:
  • An effective technology for e-training and e-learning is __________, which uses computer graphic displays that the user can adju
    12·1 answer
  • Nicole wants to create a database to collect information about sales transactions. She would like to use the database to look up
    6·2 answers
  • Which best describes Sayid’s error?
    13·1 answer
  • Who was the 1st person to use the term television
    11·1 answer
  • 16.
    7·1 answer
  • What expressions will initialize d with a random value such that all possible values for d are given by the inequality 1.5 ≤ d &
    8·1 answer
  • Whats the answer to 9? i really need help with this in the next 20 minutes. ty if u help me!
    9·1 answer
  • A TCP ________ segment is a request to the other transport process to close a connection. ACK FIN SYN CLS
    15·1 answer
  • Imagine you have borrowed your friend's computer to work on a class project. Checking
    13·1 answer
  • You implement basic version control and go through the phase of creating a local repository. Initiate the commands to set up tha
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!