Question

What are the main characteristics of a binary search tree? In your opinion, what advantages does...

What are the main characteristics of a binary search tree? In your opinion, what advantages does a binary search tree have over a linked list or an array? Assuming you want to create a binary search tree of integers, draw the resulting tree if the integers input were as follows :

25 43 12 20 5 50 30

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

Binary Search Tree :  Binary search tree is a binary tree in which the keys in the left subtree are smaller than the key in the root and the keys in the right subtree are greater than the key in the root.

  • In this no two elements can have same key.
  • Left and right subtree are also binary search trees.

Advantages:

  • Insertion , deletion and search operation can be performed in logarithmic time complexity O(logn)
  • Elements are stored in an order.For eg. if we need to find elements in increasing order we just need in-order traversal(L ->N->R).
  • We can perform range queries like if we want to find numbers between two numbers present in the tree.

Disadvantages:

  • The shape depends on the order of insetion and it can be degenerated.
  • Implementation of balanced binary tree is required for logarithmic time complexity.

Tree for given input 25,43,12,20,5,50,30

wertu2 Suau u324く on th. Jg4.uda! 12 12. ML dlu

Please rate if you liked the answer, would be glad if it helped:)

Add a comment
Know the answer?
Add Answer to:
What are the main characteristics of a binary search tree? In your opinion, what advantages does...
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
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