For this problem I need to find the smallest integer in an ArrayList and move it to the front of the list without changing the order of the other list elements. I created the code to find the smallest value. I just can't figure out how to move it to the front of the list. Here's my code so far:
So you know what index in the ArrayList the smallest element occupies right? So the next step is to remove it and add it at the first index in the ArrayList.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter