MrDude1515
January 9th, 2011, 09:19 PM
Given an integer, and a small list of other integers, I need to add and subtract integers from the small list to get the first one.
In practice in my program, the target integer is in the range 0-63, and the list is [6,10,15,17]. I can add or subtract any of those as many times as I want to hit my target integer.
I've never written a single algorithm before, so I don't know if I'm even approaching it the right way. My initial thought was to solve a few problems on my own and see if I could find any sort of recursive process that I was following to reach my answer. I didn't make much headway with that.
I'm not looking for someone to just give me the answer - in fact, I'd rather that not happen. I was hoping someone could tell me where to start working on this, since I haven't a clue where to start writing an algorithm.
In practice in my program, the target integer is in the range 0-63, and the list is [6,10,15,17]. I can add or subtract any of those as many times as I want to hit my target integer.
I've never written a single algorithm before, so I don't know if I'm even approaching it the right way. My initial thought was to solve a few problems on my own and see if I could find any sort of recursive process that I was following to reach my answer. I didn't make much headway with that.
I'm not looking for someone to just give me the answer - in fact, I'd rather that not happen. I was hoping someone could tell me where to start working on this, since I haven't a clue where to start writing an algorithm.