Sha256: ffb7e3f6b45c8ce82cdae7f40ca182b7784ce916aaca364626e8527d2236257d
Contents?: true
Size: 300 Bytes
Versions: 7
Compression:
Stored size: 300 Bytes
Contents
class Array # # Returns the middle element of odd-sized arrays. For even arrays, # it will return one of the two middle elements. Precisely which is # undefined, except that it will consistently return one or the # other. # def sorted_median return self[(size - 1) * 0.5] end end
Version data entries
7 entries across 7 versions & 1 rubygems