mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 14:58:50 +00:00
24 lines
509 B
Text
24 lines
509 B
Text
|
|
import Collection;
|
||
|
|
|
||
|
|
local tree = {}, i;
|
||
|
|
|
||
|
|
for i := 100, i >= 1, i := i-1 do
|
||
|
|
tree := insert (tree, i, i);
|
||
|
|
printf ("Inserting: %s\n", i.string);
|
||
|
|
printf ("Result : %s\n", tree.string)
|
||
|
|
od;
|
||
|
|
|
||
|
|
tree := {};
|
||
|
|
|
||
|
|
for i := 1, i <= 100, i := i+2 do
|
||
|
|
tree := insert (tree, i, i);
|
||
|
|
printf ("Inserting: %s\n", i.string);
|
||
|
|
printf ("Result : %s\n", tree.string)
|
||
|
|
od;
|
||
|
|
|
||
|
|
for i := 2, i <= 100, i := i+2 do
|
||
|
|
tree := insert (tree, i, i);
|
||
|
|
printf ("Inserting: %s\n", i.string);
|
||
|
|
printf ("Result : %s\n", tree.string)
|
||
|
|
od
|