Sorting algorithms/Merge sort: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add SETL) |
m (→{{header|Component Pascal}}: change "StdLog" to "Out") |
||
Line 2,976: | Line 2,976: | ||
(* Import Modules: *) |
(* Import Modules: *) |
||
⚫ | |||
⚫ | |||
(* Type Definitions: *) |
(* Type Definitions: *) |
||
Line 3,027: | Line 3,029: | ||
WHILE s # NIL DO |
WHILE s # NIL DO |
||
IF count = 10 THEN |
IF count = 10 THEN |
||
Out.Ln; (* Insert a newline after displaying 10 numbers *) |
|||
count := 0 |
count := 0 |
||
END; |
END; |
||
Out.Int(s.value, 4); |
|||
s := s.next; |
s := s.next; |
||
INC(count) |
INC(count) |
||
Line 3,050: | Line 3,052: | ||
b(590); b(255); b(101); b(485); b(801); b(223); b(645); b(458); |
b(590); b(255); b(101); b(485); b(801); b(223); b(645); b(458); |
||
b(068); b(683); |
b(068); b(683); |
||
Out.String("Before:"); Out.Ln; |
|||
Show(s); |
Show(s); Out.Ln; |
||
s := t.Sort(s)(List); |
s := t.Sort(s)(List); |
||
Out.String("After:"); Out.Ln; |
|||
Show(s); |
Show(s); Out.Ln |
||
END Use; |
END Use; |
||
END RosettaMergeSortUse. |
END RosettaMergeSortUse.Use |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
Execute: ^Q RosettaMergeSortUse.Use |
Execute: ^Q RosettaMergeSortUse.Use |