|
-
December 13th, 2012, 06:32 AM
#4
Re: nested for loops
a recursive or backtracking algorithm seems like the obvious first approach i'd go for.
From a pure mathematical p.o.v. I don't think there is method for solving this (it's a fitting problem), and that means brute forcing.
Of course there are gradients in what you consider "brute force". A recursive or backtracking solution would just be "smart" approaches to brute forcing (you attempt to try the most likely solutions first), but in a worst case scenario, you could be ending up trying every possible combination anyway.
The fact it is about "loops and algorithms", would lead me to believe the idea is in fact to try a backtracking approach.
You didn't mention the title of the book.
Most book publishers, or the authors host accompanying cd's/disks on their website.
Even if they don't, someone else that bought the book may have the disk on his website.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|