0 0 votes Number of comparision in searching an element in a binary search tree is ? Data Structures data-structures binary-search-tree time-complexity gateforum-test-series + – Kashyap Avinash 808 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 1 1 vote In worst case that's either left or skewed.. searching number may be present at leaf node.. so for worst case it's O(n).. For balanced binary search tree it's O(log n).. kirti singh answered Nov 10, 2016 • selected Nov 10, 2016 by Kashyap Avinash kirti singh comment Share Follow See all 3 Comments 3 3 Comments reply Kashyap Avinash commented Nov 10, 2016 reply Follow flag but in binary search tree we compare and decide either to go to left child or right and we end with the leaf node if searched key is not present so the answer should be O(log n). I m really confused in this please help me out. 0 0 replyShare Kashyap Avinash commented Nov 10, 2016 reply Follow flag Ok got it thanks by the way i was ignoring the skewed condition. 0 0 replyShare kirti singh commented Nov 10, 2016 reply Follow flag Ur wlcm :) 0 0 replyShare Please log in or register to add a comment.