Saturday, June 27, 2009

Problem 1

So I realize that I have not made good on my promise to post the problems I've worked like I said I would in this post, but rest assured I'm working on it....kinda. But without further adieu, I present to you my solutions for the first problem list in that book from the previous post.

my solutions

I constructed both a recursive and non-recursive solution and ran a mini benchmark between the two.



As you can see, though the benchmark was small, the recursive solution was slower...not too surprising because my dev machine isn't the newest there is on the market.

Total programming time: 30 mins (and honestly, most of that time was spent looking for the unix solution to track the milliseconds it took each solution to run...i've only ever done benchmark stuff on a windows environment.)

Difficulty: Easy.

You have another solution, hit me!