Question DSA-TREE-0055
MediumWhich traversal uses O(1) extra space by temporarily changing null pointers?
- A.
Recursive preorder
- B.
Morris traversal
- 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
Which traversal uses O(1) extra space by temporarily changing null pointers?
Recursive preorder
Morris traversal
Sign up free to see the answer and a step-by-step explanation.
Iterative DFS with a stack
Level-order traversal