package Stack;
import java.util.Stack;
public class Try {
public static void main(String[] args) {
Stack <Integer >stack = new Stack ();
stack.push(9);
System.out.println(stack.peek());
System.out.println(stack.contains(9));
}
}
public void nonre_preorder_iterator(Node node){
if(node == null) {
return;
}
Stack st = new Stack();
st.push(node);
while (st.empty() != true) {
Node curr = (Node) st.pop();
System.out.println(curr.id);
if (curr.rightchild != null) {
st.push(curr.rightchild);
}
if (curr.leftchild != null) {
st.push(curr.leftchild);
}
}
}