Inorder Tree Traversal algorithm for a Binary Search Tree using Stack
问题 My inputs results 24, 4, 2, 3, 9, 10, 32 , and I am getting following result 2, 3, 4, 24 . I am using a stack . When I have manually checked this program the node is not going through else if at 4 on stack, even if has right sub tree. public void inorderNonRcursive(Node root){ Stack s = new Stack(); Node node = root; Node k; int c=0; if(node != null) { s.push(node); } while(!s.stack.isEmpty()) { //node=(Node) s.stack.get(s.stack.size()-1); System.out.println("first condition" + (node.getleft(