Guest User

Untitled

a guest
Mar 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. def printt()
  2. a = [nil, 3, nil]
  3. b = [nil, 5, nil]
  4. c = [nil, 10, nil]
  5. nuevo = [nil, 50, nil] # crear un nodo nuevo
  6.  
  7. a[2] = b
  8. b[0] = a
  9. b[2] = c
  10. c[0] = b
  11.  
  12. ## add
  13. inicio = a
  14.  
  15. if inicio == nil
  16. # inicio = nuevo
  17. else
  18. nuevo[2] = inicio
  19. inicio[0] = nuevo
  20. inicio = nuevo
  21. end
  22.  
  23.  
  24. print a
  25. end
  26.  
  27. printt();
Add Comment
Please, Sign In to add comment