7 kyu
Bubble Sort
721 of 983PrivateShorty
Description:
#Bubbleing around
Since everybody hates chaos and loves sorted lists we should implement some more sorting algorithms. Your task is to implement a Bubble sort (for some help look at https://en.wikipedia.org/wiki/Bubble_sort) and return a list of snapshots after each change of the initial list.
e.g.
If the initial list would be l=[1,2,4,3] my algorithm rotates l[2] and l[3] and after that it adds [1,2,3,4] to the result, which is a list of snapshots.
[1,2,4,3] should return [ [1,2,3,4] ]
[2,1,4,3] should return [ [1,2,4,3], [1,2,3,4] ]
[1,2,3,4] should return []
Sorting
Arrays
Fundamentals
Algorithms
Similar Kata:
Stats:
Created | May 21, 2016 |
Published | May 21, 2016 |
Warriors Trained | 2582 |
Total Skips | 36 |
Total Code Submissions | 3523 |
Total Times Completed | 983 |
Python Completions | 721 |
JavaScript Completions | 279 |
Total Stars | 41 |
% of votes with a positive feedback rating | 89% of 187 |
Total "Very Satisfied" Votes | 156 |
Total "Somewhat Satisfied" Votes | 21 |
Total "Not Satisfied" Votes | 10 |
Total Rank Assessments | 15 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |