    procedure search( key : typekey; t : btree );

    var i : integer;
    begin
    if t=nil then {*** Not Found ***}
        notfound( key )
    else with t^ do begin
        i := 1;
        while ( i<d ) and ( key>k[i] ) do i := i+1;
        if key = k[i] then   {*** Found ***}
             found( t^, i )
        else if key < k[i] then search( key, p[i-1] )
             else               search( key, p[i] )
        end
    end;
