What is the time complexity of insertion,deletion and searching an element in binary tree and binary search tree ? please give the correct comparison ?

# What is the time complexity of insertion,deletion and searching an element in binary tree and binary search tree?

**Isha_Kashyap**#2

for binary search tree :

Algorithm Average Worst Case

Space O(n) O(n)

Search O(log n) O(n)

Insert O(log n) O(n)

Delete O(log n) O(n)

see this doc http://bigocheatsheet.com/

for the time complexities in one place

**Spriha**#3

Binary Tress:

- insertion:O(n*n)
- Deletion:O(log n)
- Searching:

Binary Search Tree: - Insertion O(n)
- Deletion:O(n) for worst case.O(log n) for best case
- Searching:O(n)

**dhanashri**#5

Average case for all the operations of BST is O(log n)

Worst case is O(n) where n is the height of the tree