Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String s = "";
- Stack<BSTNode<T>> pila = new ALStack<BSTNode<T>>();
- pila.push(null);
- BSTNode<T> act = nodo;
- while (act != null) {
- while (act != null) {
- pila.push(act);
- act = act.left;
- }
- act=pila.pop();
- boolean tieneder= false;
- while(act != null && tieneder == false){
- s+=act.nodeValue + " ";
- if(act.right!=null){
- act=act.right;
- tieneder=true;
- }else{
- act=pila.pop();
- }
- }
- }
- return s;
Add Comment
Please, Sign In to add comment