Recall & Review
beginner
What is the main advantage of Morris Traversal for inorder tree traversal?
Morris Traversal uses no extra space like stack or recursion. It achieves inorder traversal with O(1) space by temporarily modifying the tree's right pointers.
Click to reveal answer
intermediate
In Morris Traversal, what is the purpose of creating a temporary thread (link) from the inorder predecessor to the current node?
The temporary thread allows returning to the current node after visiting its left subtree without using a stack or recursion.
Click to reveal answer
intermediate
What happens when the inorder predecessor's right pointer is already pointing to the current node in Morris Traversal?
It means the left subtree has been fully visited. The thread is removed by setting the right pointer back to null, and the current node is processed.
Click to reveal answer
beginner
Why does Morris Traversal restore the tree structure after traversal?
Because it temporarily changes right pointers to create threads, it must restore them to null to keep the original tree unchanged after traversal.
Click to reveal answer
beginner
Which traversal order does Morris Traversal implement without stack or recursion?
Morris Traversal is commonly used for inorder traversal of a binary tree without stack or recursion.
Click to reveal answer
What is the space complexity of Morris Traversal for inorder traversal?
✗ Incorrect
Morris Traversal uses no stack or recursion, only modifies pointers temporarily, so space complexity is O(1).
In Morris Traversal, what do you do if the current node has no left child?
✗ Incorrect
If no left child, process current node and move to right child directly.
How does Morris Traversal find the inorder predecessor of a node?
✗ Incorrect
Inorder predecessor is the rightmost node in the left subtree.
What is the key step to avoid infinite loops in Morris Traversal?
✗ Incorrect
Removing the temporary thread prevents revisiting the same nodes endlessly.
Which of these is NOT true about Morris Traversal?
✗ Incorrect
Morris Traversal does not use recursion; it uses pointer manipulation instead.
Explain step-by-step how Morris Traversal performs inorder traversal without using a stack or recursion.
Think about how temporary links help return to nodes after left subtree.
You got /6 concepts.
Describe why Morris Traversal is useful compared to traditional inorder traversal methods.
Focus on space usage and tree structure preservation.
You got /4 concepts.