If a + b + c + d is odd then in every double column there are at least one or at most three additional ones.
Therefore, also in this case the unsorted zone consists of at most two rows.
Eventually, in Step 3 of the procedure the unsorted zone is sorted.
www.iti.fh-flensburg.deWenn a + b + c + d ungerade ist, kommen also in jeder Doppelspalte entweder mindestens eine Eins oder höchstens drei Einsen hinzu.
Somit umfasst die unsortierte Zone auch in diesem Fall höchstens zwei Zeilen.
In Schritt 3 der Prozedur wird die aus maximal zwei Zeilen, d.h. aus maximal 2k Elementen bestehende unsortierte Zone schließlich sortiert.
www.iti.fh-flensburg.deProof of the correctness of procedure 4-way merge using the 0-1-principle
By recursive application of procedure 4-way merge a totally unsorted array is roughly sorted:
Procedure roughsort (k)
www.iti.fh-flensburg.deBeweis der Korrektheit der Prozedur 4-way-merge mit Hilfe des 0-1-Prinzips
Durch rekursive Anwendung der Prozedur 4-way-merge kann ein völlig unsortiertes Feld grobsortiert werden:
Prozedur roughsort(k)
www.iti.fh-flensburg.deSince it consists of at most 2k elements, 2k oets-steps are sufficient.
By recursive application of procedure ls3-merge an unsorted array is sorted:
www.iti.fh-flensburg.deHierfür genügen 2k oets-Schritte.
Durch rekursive Anwendung der Prozedur ls3Merge kann ein völlig unsortiertes Feld sortiert werden:
www.iti.fh-flensburg.deИскате ли да добавите дума, израз или превод?
Изпратете ни нов запис.