497
правок
Изменения
→Связывание трех деревьев в одно
<code>
Fastening (p1, p2, p3) if(p1.Key<=p2.Key) and (p1.Key<=p3.Key) MinP := p1; p1 := p2; p2 := p3; if(p2.Key<=p1.Key) and(p2.Key<=p3.Key) MinP := p2; p1 := p1; p2 := p3; if(p3.Key<=p1.Key) and(p3.Key<=p2.Key) MinP := p3; p1 := p1; p2 := p2; p1.Right := p2; p1.Left := NULL; p1.Parent := MinP; p2.Right :=MinP.LChild; p2.Left :=p1; p2.Parent := MinP; if(MinP.LChild != NULL) MinP.LChild.Left = p2; MinP.LChild := p1; MinP.Rank := MinP.Rank+1; MinP.Right := NULL; MinP.Left := NULL; Fastening := MinP;
</code>