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

 

norm.krumpe@muohio.edu > insertionSort
prev  |  next  |  chance

Implement the specified number of iterations of insertion sort. Normally, sorting algorithms should have return type void. But codingbat doesn't work that way. So, return the array at the end of the method.


insertionSort([47, 2, 18, 6, 3, 59, 2, 8, 19, 5], 1) → [2, 47, 18, 6, 3, 59, 2, 8, 19, 5]
insertionSort([47, 2, 18, 6, 3, 59, 2, 8, 19, 5], 2) → [2, 18, 47, 6, 3, 59, 2, 8, 19, 5]
insertionSort([47, 2, 18, 6, 3, 59, 2, 8, 19, 5], 3) → [2, 6, 18, 47, 3, 59, 2, 8, 19, 5]

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

int[] insertionSort(int[] nums, int iterations) { }

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: 200

Copyright Nick Parlante 2017 - privacy