- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Comparison of Search Trees in Data Structure
Here we will see some search trees and their differences. There are many different search trees. They are different in nature. The basic search tree is Binary Search Tree (BST). Some other search trees are AVL tree, B tree, Red-Black tree, splay tree etc.
These trees can be compares based on their operations. We will see the time complexity of these trees
Search Tree | Average Case | ||
---|---|---|---|
Insert | Delete | Search | |
Binary Search Tree | O(log n) | O(log n) | O(log n) |
AVL tree | O(log2 n) | O(log2 n) | O(log2 n) |
B Tree | O(log n) | O(log n) | O(log n) |
Red-Black Tree | O(log n) | O(log n) | O(log n) |
Splay Tree | O(log2 n) | O(log2 n) | O(log2 n) |
Search Tree | Worst Case | ||
---|---|---|---|
Insert | Delete | Search | |
Binary Search Tree | O(n) | O(n) | O(n) |
AVL tree | O(log2 n) | O(log2 n) | O(log2 n) |
B Tree | O(log n) | O(log n) | O(log n) |
Red-Black Tree | O(log n) | O(log n) | O(log n) |
Splay Tree | O(log2 n) | O(log2 n) | O(log2 n) |
Advertisements