Курсовая работа: Компрессия информации и упорядочение дерева по алгоритму Виттера
c. MoveTo(x,y);
c. LineTo(x-(ofs div 2),y+30);
end;
if(T. Right<>nil) then
begin
c. MoveTo(x,y);
c. LineTo(x+(ofs div 2),y+30);
end;
C. Ellipse(x-12,y-12,x+12,y+12);
if t. isleaf then if t. symbol=#0 then C. TextOut(x-4,y-25,'*') else C. TextOut(x-4,y-25,t. Symbol);
C. TextOut(x-6,y-7, inttostr(T. wiegth));
C. TextOut(x-6,y+12, inttostr(T. number));
Draw(T. Left,x-(ofs div 2),y+30,level+1,ofs div 2);
Draw(T. Right,x+(ofs div 2),y+30,level+1,ofs div 2);
end;
end;
begin
C: =D. Canvas;
C. Brush. Color: =clBtnFace;
C. FillRect(D. ClientRect);
Draw(P,w div 2,30,1,w div 2);
end;
procedure MakeDeCodeTable(Top: PTree);
procedure CT(P: PTree; code: string);
begin
if P<>nil then
begin
if (P. Wiegth>=0) and (P. IsLeaf) then
begin