about | help | code help+videos | done | prefs |
Write a single-pass "bubble up" sort. This method will perform only a single-pass through an array 'nums' and swap numbers that are out of order with the larger numbers "bubbling up" towards the right end of the array. If the array is already fully ordered, that array is returned unchainged. Look at the test data for examples. mar7_2017_SLHL_bubbleOnce([]) → [] mar7_2017_SLHL_bubbleOnce([17436]) → [17436] mar7_2017_SLHL_bubbleOnce([853, 5231, 435, 867, 354, 745, 125, 835, 3445, 8764, 24356]) → [853, 435, 867, 354, 745, 125, 835, 3445, 5231, 8764, 24356] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy