Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
749 views
in Computer by (69.2k points)

Equal keys pose problem for the implementation of Binary Search Trees. What is the asymptotic performance the usual algorithm to insert n items with identical keys into an initially empty Binary Search Tree? Propose some technique to improve the performance of the algorithm. 

1 Answer

+2 votes
by (69.7k points)
selected by
 
Best answer

A sympotic performance will be linear in O(n). That is the tree created will be skew symmetric. Identical keys should be attached either as left or right child of the parent, wherever positions are available. For eg. 18,3,5,2,4,7,2,9,2,16,2,11,2,10,2 

The creation of the tree should be as follows: 

i.e. similar keys should not skew to the BST. Then performance will become inferior.  

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...