Partition (low, high,var Pivot:integer);
var i, j, PivotItem:integer;
begin
PivotItem:=A[low];
i:=low; j:=high;
while (i<j) do
begin
swap (A[i], A[j]);
while (A[i]<PivotItem) do
i:=i+1;
while (A[j]>=PivotItem) do
j:=j-1;
end;
Pivot:=I;
swap (A[high], A[PivotPoint]);
end;
---------- Post added at 02:40 PM ---------- Previous post was at 02:38 PM ----------
function search (x:element_type; x:hash):Boolean;
var i:integer;
p:list;
begin
i:=h(x);
p:=s[i];
while (p<>nil) and (p^.element<>x) do
p:=p^.next;
if p=nil then
return false
else
return true;
end;
تمرين: رويه هاي delete و insert را در روش Open hash بنويسيد.