Sorting algorithms/Selection sort: Difference between revisions

Content deleted Content added
m use ranges in Crystal implementation, makes it more unique to Crystal
No edit summary
Line 1,920:
data = selectionSort #(4, 9, 3, -2, 0, 7, -5, 1, 6, 8)
print data</lang>
 
=={{header|Nanoquery}}==
{{trans|Java}}
<lang Nanoquery>import math
 
def sort(nums)
global math
for currentPlace in range(0, len(nums) - 2)
smallest = math.maxint
smallestAt = currentPlace + 1
for check in range(currentPlace, len(nums) - 1)
if nums[check] < smallest
smallestAt = check
smallest = nums[check]
end
end
temp = nums[currentPlace]
nums[currentPlace] = nums[smallestAt]
nums[smallestAt] = temp
end
return nums
end</lang>
 
=={{header|N/t/roff}}==