跟Pascal一样啊!!看看下面的源代码对你有没有帮助了!!
type
PFolder = ^Folder;
Folder = Record
data: String;
node: PFolder;
end;
var
Head,p,q: PFolder;
procedure Insert;
begin
new(p);
p^.data := 'Aa'
p^.node := nil;
new(Head);
Head^.node := p;
While Condictiondo
begin
new(q);
q^.data := '';
q^.node := nil;
p^.node := q;
p := q;
if Assign(q) then
destroy(q);
end;
if Assign(p) then
destroy(q);
end;
procedure Del;
begin
p := Head;
While p <> nildo
begin
if p^.data = condiction then
begin
q := p;
p := p^.node;
if Assign(q) then
destroy(q);
break;
end;
end;
end;