Question DSA-TREE-0019
HardWhat is the time complexity of finding the height of a binary tree with n nodes?
- A.
O(n log n)
- B.
O(n)
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Trees question
What is the time complexity of finding the height of a binary tree with n nodes?
O(n log n)
O(n)
Sign up free to see the answer and a step-by-step explanation.
O(log n)
O(1)