2. Trace the non-recursive inorder traversal algorithm (PP.26 in Chapter 16 slides) for the binary search tree in the following figure. Show the contents of the stack as the traversal progresses. You are given an example with the first few steps, and you need to continue drawing the stacks using the same formats of the first few steps given until you finish the inorder traversal. (5)
done: false curPtr: 60 nodeStack:
false 20
false false false false false false 10 nullptr 10 10 nullptr 20
false false 20 40
false 40
false
false nullptr
10 20 60
10 20 60
10 Visit 10 20 20 60 60
Visit 20
30 40 60
30 40 60
20 60
20 60
40 60
60
60