What will be the correct sequence of insertion for the following k-d tree?

Category: QuestionsWhat will be the correct sequence of insertion for the following k-d tree?
Editor">Editor Staff asked 5 months ago

What will be the correct sequence of insertion for the following k-d tree?
 
(a) (30,40),(5,25),(70,70),(10,12),(50,30),(35,45)
 
(b) (40,30),(5,25),(12,10),(70,70),(30,50),(45,35)
 
(c) (30,40),(5,25),(10,12),(70,70),(50,30),(35,45)
 
(d) (40,30),(25,5),(12,10),(70,70),(50,30),(45,35)
 
My doubt stems from Trees in section Trees of Data Structures & Algorithms I
 
I got this question during an online exam.

1 Answers
Editor">Editor Staff answered 5 months ago

Right answer is (c) (30,40),(5,25),(10,12),(70,70),(50,30),(35,45)
 
Explanation: The correct sequence of insertion of the above given tree is (30,40),(5,25),(10,12),(70,70),(50,30),(35,45). The insertion is given by, first left, then right.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702