Jump to content

Sorting algorithms/Bubble sort: Difference between revisions

m
Categorizing programming examples
(Properly ordering the languages)
m (Categorizing programming examples)
Line 5:
 
==[[Ada]]==
[[Category:Ada]]
'''Compiler:''' GCC 4.1.2
 
Line 53 ⟶ 54:
{{array operation}}
 
==[[C plus plus|C++]]==
[[Category:C plus plus]]
'''Compiler:''' g++ 4.0.2
 
Line 104 ⟶ 106:
 
==[[Perl]]==
[[Category:Perl]]
'''Interpreter:''' perl 5.8.8
 
Line 152 ⟶ 155:
 
==[[Python]]==
[[Category:Python]]
 
def bubblesort(x):
for i in range(len(x) - 2):
Line 164 ⟶ 167:
 
==[[Ruby]]==
[[Category:Ruby]]
Sorting can be done with the sort method
new_array = [3, 78, 4, 23, 6, 8, 6].sort
Cookies help us deliver our services. By using our services, you agree to our use of cookies.