#please help

4 messages · Page 1 of 1 (latest)

copper finch
#

Suppose we have a list nbrList of type ArrayList<Integer>. The numbers in the list are sorted in ascending order. Change the code to insert the number nbr so that instead of being inserted last, it is sorted into the correct place in the list.

Example: If nbrList contains the numbers 5, 7, 12, 20 and nbr has the value 8, the list must contain 5, 7, 8, 12, 20 after the insertion.

ocean brookBOT
#

This post has been reserved for your question.

Hey @copper finch! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

jagged pollen
#

what have you tried? what exactly are you stuck on?