Coding Quiz - Implement Bubble Sort
Based on what you've learned so far, implement the bubble sort
algorithm yourself.
Write Your Code
def solution(numbers):
# Write your code here
return
Constraints
-
numbers
is a list containing numbers. -
The
length of the list
must be at least 1.
Input/Output Examples
-
Input:
[34, 2, 1, 78, 56]
-
Output:
[1, 2, 34, 56, 78]
-
Input:
[5, 3, 8, 4, 2]
-
Output:
[2, 3, 4, 5, 8]
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.