Guest User

Untitled

a guest
Apr 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. String s = "";
  2. Stack<BSTNode<T>> pila = new ALStack<BSTNode<T>>();
  3. pila.push(null);
  4. BSTNode<T> act = nodo;
  5. while (act != null) {
  6. while (act != null) {
  7. pila.push(act);
  8. act = act.left;
  9. }
  10. act=pila.pop();
  11. boolean tieneder= false;
  12. while(act != null && tieneder == false){
  13. s+=act.nodeValue + " ";
  14. if(act.right!=null){
  15. act=act.right;
  16. tieneder=true;
  17. }else{
  18. act=pila.pop();
  19. }
  20. }
  21. }
  22. return s;
Add Comment
Please, Sign In to add comment