#Need help in Java assignments

15 messages · Page 1 of 1 (latest)

maiden star
bronze jettyBOT
#

This post has been reserved for your question.

Hey @maiden star! 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.

#

We won't do your homework for you. Try the problem first, and if you have a question on a specific part of the problem, or your implementation of the problem, we can help!

maiden star
#

i just need to know how do i take input if the length of the array isn't given

chrome cradle
#

read the entire line as a string then split it

#

or you could also not use an array

#

you could read numbers sequentially as well (not storing them at all, since the input is sorted)

#

or you could use a different structure like a List

maiden star
#

i tried using arraylist.. but in that .. like i get the expected result.. but how do i jump to next test case.

#

like in the first test case.. 3 should be placed between 1 and 4

#

i could return those ..

#

but how will i get the next k (next number for which i've to find the position)

chrome cradle
#

just, read the input again?

#
read case count
handle case count
  handle queue logic

cases = input
for i < cases.length
pos = input
queue = input
output queue before pos
output queue after pos