answersLogoWhite

0


Best Answer

O(log n)

At each step of insertion you are either going to the left child or the right child. In a balanced tree, this will effectively cut the number of possible comparisons in half each time.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is complexity of insertion in binary search tree?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is complexity of binary search tree?

The complexity of binary search tree : Search , Insertion and Deletion is O(h) . and the Height can be of O(n) ( if the tree is a skew tree). For Balanced Binary Trees , the Order is O(log n).


In binary search tree n equals nodes h equals height of tree what is time complexity?

O(h)


Advantages and disadvantages of binary search tree?

Advantages:BST is fast in insertion and deletion etc when balanced.Very efficient and its code is easier than link lists.Disadvantages:Shape of the tree depends upon order of insertion and it can be degenerated.Searching takes long time.


Does binary tree and binary search tree same?

no they are not same


What is the binary search tree worst case time complexity?

Binary search is a log n type of search, because the number of operations required to find an element is proportional to the log base 2 of the number of elements. This is because binary search is a successive halving operation, where each step cuts the number of choices in half. This is a log base 2 sequence.


What is meant by the expression traversing by a binary tree?

you do anything with binary element that is traversing. insertion,deletion, accesing anything.............


How do you print all data in a Binary Search Tree?

By using Depth First Search or Breadth First search Tree traversal algorithm we can print data in Binary search tree.


What is the difference between extended binary tree and a binary search tree?

A strictly binary tree is one where every node other than the leaves has exactly 2 child nodes. Such trees are also known as 2-trees or full binary trees. An extended binary tree is a tree that has been transformed into a full binary tree. This transformation is achieved by inserting special "external" nodes such that every "internal" node has exactly two children.


What is the different between a binary search tree and a binary tree?

self depend friend"s............


Complexity of an algorithm in data structure?

* search array => O(1) linked list=> O(n) binary tree=> O(log n) hash=>O(1) * search array => O(1) linked list=> O(n) binary tree=> O(log n) hash=>O(1)


Is sorting a binary search tree simple?

A binary search tree is already ordered. An in order traversal will give you a sorted list of nodes.


What is the use of binary?

Binary trees are commonly used to implement binary search tree and binary heaps.