Advertisement
StudentSeng

Explaining In-Order Traversal: Output

Feb 20th, 2021
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. [Moving to left node: 2]
  2. [Pushing current node to Stack: [4] ]
  3.  
  4. [Moving to left node: 1]
  5. [Pushing current node to Stack: [4, 2] ]
  6.  
  7. [Moving to node: None]
  8. [Pushing current node to Stack: [4, 2, 1] ]
  9.  
  10. [Popping current node from Stack: [4, 2] ]
  11. [Returned to previous node: 1]
  12.  
  13. PRINT: 1
  14.  
  15. [Moving to node: None]
  16. [Pushing current node to Stack: [4, 2, 1] ]
  17.  
  18. [Popping current node from Stack: [4, 2] ]
  19. [Returned to previous node: 2]
  20.  
  21. PRINT: 2
  22.  
  23. [Moving to right node: 3]
  24. [Pushing current node to Stack: [4, 2, 2] ]
  25.  
  26. [Moving to node: None]
  27. [Pushing current node to Stack: [4, 2, 2, 3] ]
  28.  
  29. [Popping current node from Stack: [4, 2, 2] ]
  30. [Returned to previous node: 3]
  31.  
  32. PRINT: 3
  33.  
  34. [Moving to node: None]
  35. [Pushing current node to Stack: [4, 2, 2, 3] ]
  36.  
  37. [Popping current node from Stack: [4, 2, 2] ]
  38. [Returned to previous node: 4]
  39.  
  40. PRINT: 4
  41.  
  42. [Moving to right node: 6]
  43. [Pushing current node to Stack: [4, 2, 2, 4] ]
  44.  
  45. [Moving to left node: 5]
  46. [Pushing current node to Stack: [4, 2, 2, 4, 6] ]
  47.  
  48. [Moving to node: None]
  49. [Pushing current node to Stack: [4, 2, 2, 4, 6, 5] ]
  50.  
  51. [Popping current node from Stack: [4, 2, 2, 4, 6] ]
  52. [Returned to previous node: 5]
  53.  
  54. PRINT: 5
  55.  
  56. [Moving to node: None]
  57. [Pushing current node to Stack: [4, 2, 2, 4, 6, 5] ]
  58.  
  59. [Popping current node from Stack: [4, 2, 2, 4, 6] ]
  60. [Returned to previous node: 6]
  61.  
  62. PRINT: 6
  63.  
  64. [Moving to right node: 7]
  65. [Pushing current node to Stack: [4, 2, 2, 4, 6, 6] ]
  66.  
  67. [Moving to node: None]
  68. [Pushing current node to Stack: [4, 2, 2, 4, 6, 6, 7] ]
  69.  
  70. [Popping current node from Stack: [4, 2, 2, 4, 6, 6] ]
  71. [Returned to previous node: 7]
  72.  
  73. PRINT: 7
  74.  
  75. [Moving to node: None]
  76. [Pushing current node to Stack: [4, 2, 2, 4, 6, 6, 7] ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement