Υλοποίηση σε Pascal

Παράδειγμα:
program bintree;

type
    binTree = ^binTreeElem;

    binTreeElem = record
        val : integer;
        left : binTree;
        right : binTree;
    end;


var
    theTree, node : binTree;

begin
    new(node);
    node^.val := 5;
    node^.left := nil;
    node^.right := nil;
    theTree := node;

    new(node);
    node^.val := 12;
    node^.left := nil;
    node^.right := nil;
    theTree^.right = node;
end.