Kod: Zaznacz cały
program test;
uses AVL_Tree;
const N = 10;
type Number = ^Integer;
var all : TAVLTree;
actual :TAVLTreeNode;
a,i :Integer;
t : array[1..N] of Integer;
x :Number;
function compare(a,b:Pointer):LongInt;
begin
compare := Number(a)^ - Number(b)^;
end;
begin
randomize;
for i := 1 to N do
t[i] := i;
all := TAVLTree.Create(@compare);
for i := N downto 1 do
begin
a:=1+random(i);
new(x);
x^:=t[a];
all.add(x);
t[a]:=t[i];
end;
actual := all.findLowest;
while actual <> nil do
begin
Writeln(Number(actual.data)^);
dispose(Number(actual.data));
actual := all.FindSuccessor(actual);
end;
all.Free;
end.
podczas kompilacji daje mi komunikat:
i nie wiem co jest graneCompiling avl.pas
Fatal: Can't find unit AVL_Tree used by test
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)
cos pewnie powinienem sciagnac ale nic nie widze w necie na ten temat
prosze pomozcie
-- 30 mar 2012, o 21:09 --
ok wystarczylo sciagnac FCL problem solved