id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

sort_bubbleSortOnePass


Given an integer array, complete one pass of using the Bubble Sort Algorithm. The bubble sort algorithm goes left to right through the array swapping elements that are out of order in an attempt to make it sorted least to greatest.


sort_bubbleSortOnePass([5, 4, 3, 2, 1]) → [4, 3, 2, 1, 5]
sort_bubbleSortOnePass([4, 3, 2, 1, 5]) → [3, 2, 1, 4, 5]
sort_bubbleSortOnePass([3, 2, 1, 4, 5]) → [2, 1, 3, 4, 5]

...Save, Compile, Run (ctrl-enter)

public int[] sort_bubbleSortOnePass(int[] nums){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy