We are give a BST with n nodes and our task is to balance this BST. What will…

We are give a BST with n nodes and our task is to balance this BST. What will be the time complexity of most efficient algorithm that solves our task?

  1. A.

    O(n2)

  2. B.

    O(n)

  3. C.

    O(log n)

  4. D.

    O(n logn)

Attempted by 431 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…