5 ArrayedCollection classMethod!
9 ArrayedCollection classMethod!
15 ArrayedCollection classMethod!
16 with: firstObject with: secondObject
18 at: 1 put: firstObject;
19 at: 2 put: secondObject;
22 ArrayedCollection classMethod!
23 with: firstObject with: secondObject with: thirdObject
25 at: 1 put: firstObject;
26 at: 2 put: secondObject;
27 at: 3 put: thirdObject;
30 ArrayedCollection classMethod!
31 with: firstObject with: secondObject with: thirdObject with: fourthObject
33 at: 1 put: firstObject;
34 at: 2 put: secondObject;
35 at: 3 put: thirdObject;
36 at: 4 put: fourthObject;
41 ArrayedCollection method!
43 ^ self shouldNotImplement!
48 ArrayedCollection method!
50 self sortBy: [ :u :v | u <= v ]!
52 ArrayedCollection method!
54 self mergeSortWithBuffer: (Array new: self size)
59 ArrayedCollection method!
60 mergeSortWithBuffer: buf low: lo high: hi sortBlock: aBlock
62 Copyright (C) Jeffrey Stedfast
63 http://jeffreystedfast.blogspot.com/2007/02/merge-sort.html"
70 mid := lo + ((hi - lo) // 2).
72 self mergeSortWithBuffer: buf
76 self mergeSortWithBuffer: buf
85 [(l <= mid) & (h <= hi)]
87 [(aBlock value: (self at: l) value: (self at: h))
88 ifTrue: [buf at: i put: (self at: l). l := l + 1]
89 ifFalse: [buf at: i put: (self at: h). h := h + 1].
94 [buf at: i put: (self at: l). i := i + 1. l := l + 1].
97 [buf at: i put: (self at: h). i := i + 1. h := h + 1].