Start learning 50% faster. Sign in now
In a balanced binary search tree (BST) , the height of the tree is maintained as O(log n)), ensuring that each level of the tree splits the search space roughly in half. This property allows searching for an element in the tree with logarithmic time complexity. For example, consider a balanced BST with 15 nodes. The height is approximately log 215≈4, so searching for any element will involve checking at most 4 nodes from the root to a leaf. The logarithmic reduction at each step (halving the search space) makes this approach efficient for large datasets. Balanced trees such as AVL or Red-Black trees maintain this logarithmic height through rotation operations during insertion and deletion, ensuring the O(log n) search time even after multiple modifications. Explanation of Incorrect Options: A) O(n) : This would be the time complexity for searching in an unbalanced BST or a linked list, where all nodes are skewed to one side. However, a balanced BST ensures O(log n) complexity. C) O(n2) This complexity is not applicable to BST search operations. It might appear in poorly optimized nested loops or certain pathological cases in other algorithms. D) O(1) Constant time search is achieved in hash tables, not in BSTs, as BSTs require traversing nodes to locate the target element. E) O(nlog n) This is the complexity of sorting algorithms like Merge Sort or Heap Sort, not searching in a BST.
Which Indian district was highlighted in ISRO's Landslide Atlas of India for its high risk related to landslides?
59-minute loan approval scheme for micro, small and medium enterprises (MSMEs) Is of____?
Bank of Baroda has collaborated to offer co-branded RuPay Platinum Debit Card to beneficiaries of the state government’s ‘Pudhumai Penn’ scheme.Th...
Consider the following statements in regards to generative AI.
1) It is a transformative type of artificial intelligence.
2) Accenture has...
Consider the following statements regarding Reserve Bank of India's bi-monthly Inflation Expectations Survey of Households (IESH) -
I.The Reserve...
Who among the following was appointed as new global business head of Meta in India?
What milestone did UPI achieve in October 2024, and which transaction type primarily drove this growth?
Which of the following statements is/are not true regarding the proposed changes/changes being done by the Monetary Policy Committee?
I.The Reser...
What is the primary focus of the Memorandum of Understanding (MoU) between NTPC Green Energy Limited (NGEL) and Nayara Energy?