Advertisement
sci4me

jaja lang

Jul 28th, 2019
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. [
  2. cb:
  3. node:
  4.  
  5. node;"value".cb;!
  6.  
  7. node;"left".nil=~[node;$"left".cb;visit;!node:]?
  8. node;"right".nil=~[node;$"right".cb;visit;!node:]?
  9. ]visit:
  10.  
  11. \d: d; "value" 4 ,
  12. \e: e; "value" 5 ,
  13. \f: f; "value" 6 ,
  14. \g: g; "value" 7 ,
  15.  
  16. \b: b; "value" 2 , b;"left"d;, b;"right"e;,
  17. \c: c; "value" 3 , c;"left"f;, c;"right"g;,
  18.  
  19. \a: a; "value" 1 , a;"left"b;, a;"right"c;,
  20.  
  21. a; ["value: "print;!println;!] visit;!
  22.  
  23.  
  24.  
  25. this program prints:
  26.  
  27. value: 1
  28. value: 2
  29. value: 4
  30. value: 5
  31. value: 3
  32. value: 6
  33. value: 7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement