in reply to Re^2: sequence of positions to binary sequence
in thread sequence of positions to binary sequence

I can think of many ways to fill an array with zeroes. For example, you could start with an empty array and put a zero at the first position. Once you have an array of zeroes of a given length, you can get an array with twice as many zeroes by appending the array to itself.

What ideas have you come up with and what code have you written? This is not a site where we will do your homework for you. Most likely your course materials cover the knowledge necessary to master this task.

  • Comment on Re^3: sequence of positions to binary sequence

Replies are listed 'Best First'.
Re^4: sequence of positions to binary sequence
by coldy (Scribe) on Apr 16, 2009 at 09:11 UTC
    Not all people who ask simple questions are looking for easy homework answers. At the risk of being naughty I did not supply my ugly code, apologies for not following protocol.

    If available, course materials are indeed useful but often lack the variety of ways of answering the problem. I am always amazed of the variety of solutions presented in forums, thanks to all who gave positive feedback.