Computer Science Canada Array Question |
Author: | Raza [ Wed Mar 11, 2009 7:16 pm ] | ||
Post subject: | Array Question | ||
This question has given me something of a headache. You're supposed to solve it without creating another array. The closest I've gotten to solving is data[j]=data[13-j]; which gives me (for obvious reasons) a {14,13,12,11,10,9,8,8,9,10,11,12,13,14} array for an answer. I can't find a way around it, unless I were to find the sum of the array and then subtract each number.. or some other ludicrously time-consuming method, but I'm sure there's a quicker solution. Help? |
Author: | Tony [ Wed Mar 11, 2009 7:26 pm ] |
Post subject: | RE:Array Question |
but you could create another int variable, no? |
Author: | Raza [ Wed Mar 11, 2009 7:37 pm ] |
Post subject: | RE:Array Question |
Yes, please elaborate. |
Author: | Tony [ Wed Mar 11, 2009 8:17 pm ] |
Post subject: | RE:Array Question |
would int[] + int give you enough space to reverse the order of values in the int[] ? |
: |