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

 

jebbert@volusia.k12.fl.us > mar7_2017_SLHL_bubbleOnce
prev  |  next  |  chance

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)

public int[] mar7_2017_SLHL_bubbleOnce(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

Difficulty: 290

Copyright Nick Parlante 2017 - privacy