15 lines
348 B
Python
15 lines
348 B
Python
|
|
|
||
|
|
class BubbleSorter:
|
||
|
|
def __init__(self):
|
||
|
|
self.x = 1
|
||
|
|
|
||
|
|
def sorter(self, arr):
|
||
|
|
for i in range(len(arr)):
|
||
|
|
for j in range(len(arr) - 1):
|
||
|
|
if arr[j] > arr[j + 1]:
|
||
|
|
temp = arr[j]
|
||
|
|
arr[j] = arr[j + 1]
|
||
|
|
arr[j + 1] = temp
|
||
|
|
return arr
|
||
|
|
|
||
|
|
|