Question DSA-TREE-0071
HardWith binary lifting, what is the cost of answering one LCA query after O(n log n) preprocessing?
- A.
O(1)
- 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
With binary lifting, what is the cost of answering one LCA query after O(n log n) preprocessing?
O(1)
O(√n)
Sign up free to see the answer and a step-by-step explanation.
O(log n)
O(n)