Algorithmic approach

Programming, for all ages and all languages.
Post Reply
shikhin
Member
Member
Posts: 274
Joined: Sat Oct 09, 2010 3:35 am
Libera.chat IRC: shikhin
Contact:

Algorithmic approach

Post by shikhin »

Hi,

Since the Google Code Jam went online, I gave it a try. The first and the second problem looked okayish to me, and I was able to solve them in a relatively small amount of time. However, I got stuck trying to implement the third problem (fair and square) for large inputs efficiently, since mine timed out on the occasion. Moreover, at the time of writing this post, while I have a vague idea about the fourth problem, I realize that it's a rather hacky attempt (you can call it a smart brute force through chests, in the "lexicographic" order) and I suspect it won't work with large inputs either.

Eventually, since I'm a bit paranoid about my own capabilities (as you can see from my past posts :)), I wondered what'd be the best way to practice programming and solving problems -- what I term an algorithmic approach, for lack of any other term for the same. What I had earlier planned for this year was to read a book on Discrete Mathematics and Calculus (and maybe Concrete mathematics by Knuth), followed by TAOCP. I'd also look at another Algorithms book, probably the Introduction to Algorithms, before looking at TAOCP.

That looked like a fair approach, since I also suspect both have sufficient problems to introduce me to the skill of problem solving. I wonder if there's a better approach to achieve my aim, some pointers, or anything?

Regards,
Shikhin

P.S. I see a lot of people reply to posts by "so, what's the question" -- however, this is the general programming section, and I simply thought I'd take in views from people on whether the way I plan to become better at programming is a good way or not? Please provide your suggestions, views, tips, etc.
http://shikhin.in/

Current status: Gandr.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: Algorithmic approach

Post by Mikemk »

I learned simply by experimenting with different things and seeing what would happen.
PS, I've broke quite a few devices from this method.


When I started out, I was a, as you might say, "blind in the darkness debugger"
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
Minoto
Member
Member
Posts: 89
Joined: Thu May 12, 2011 7:24 pm

Re: Algorithmic approach

Post by Minoto »

That sounds like a sensible approach to me -- some guidance is necessary, of course, which is where the books come in, but really, I think one of the biggest keys to improving your problem-solving skills is to use them often, and preferably on problems that you find interesting. Project Euler might give you some good ones if you're mathematically inclined.
Those who understand Unix are doomed to copy it, poorly.
Post Reply