Скачиваний:
6
Добавлен:
01.05.2014
Размер:
1.55 Кб
Скачать
unit BTNode;

interface
uses BTDefs;
type TBTNode = class(TObject)
private
m_Key: array[1..KEYS_PER_NODE] of string;
m_Child: array[0..KEYS_PER_NODE] of TBTNode;
function getKey(Index: integer): string;
procedure setKey(Index: integer; k: string);
function getChild(Index: integer): TBTNode;
procedure setChild(Index: integer; c: TBTNode);
public
NumKeys: integer;
constructor Create;
property Key[Index: integer]: string read getKey write setKey;
property Child[Index: integer]: TBTNode read getChild write setChild;
end;
implementation

constructor TBTNode.Create;
var
i: Integer;
begin
for i := 1 to KEYS_PER_NODE do m_Key[i] := '';
for i := 0 to KEYS_PER_NODE do m_Child[i] := nil;
NumKeys := 0;
end;

function TBTNode.getKey(Index: integer): string;
begin
result := m_Key[Index];
end;

function TBTNode.getChild(Index: integer): TBTNode;
begin
result := m_Child[Index];
end;

procedure TBTNode.setKey(Index: integer; k: string);
begin
m_Key[Index] := k;
end;

procedure TBTNode.setChild(Index: integer; c: TBTNode);
begin
m_Child[Index] := c;
end;

end.
Соседние файлы в папке Б-деревья заготовка для лабы
  • #
    01.05.2014229 б5BTDefs.~pas
  • #
    01.05.20147.46 Кб5BTImpl.dcu
  • #
    01.05.201417.87 Кб7BTImpl.pas
  • #
    01.05.201417.87 Кб5BTImpl.~pas
  • #
    01.05.20142.07 Кб5BTNode.dcu
  • #
    01.05.20141.55 Кб6BTNode.pas
  • #
    01.05.20141.55 Кб5BTNode.~pas
  • #
    01.05.2014434 б5BTrees.cfg
  • #
    01.05.20142.26 Кб5BTrees.dof
  • #
    01.05.20141.1 Кб5BTrees.dpr
  • #
    01.05.20141.15 Кб5BTrees.~dpr