12 Replies - 2231 Views - Last Post: 29 December 2012 - 02:25 PM

#1 pokiaka  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 76
  • Joined: 05-August 11

Trying to get started with algorithms

Posted 28 December 2012 - 02:50 PM

Hey people,

Okay, so I've been coding and programming for a while in various languages but I wanted to take up algorithms.

So I tried to begin learning, and I thought to myself how wonderful would it be if there was a good book that introduces this subject. Well, I started reading Cormen's book Introduction to Algorithms (which sounds perfect but it was more of an Introduction To Hell). It was really heavy, so I tried over and over and over and read the same paragraphs a lot of times, and there were 3 lines of code that I tried to understand what they meant and it took me 1 hour to try and understand them (and finally give up. I still don't know they mean).

Anyways, I decided I shouldn't learn from this book and I should find something else, but I don't want a reference type of book. I need something that would teach me how to think in way of algorithms.

When I first tried to learn recursion I was at a loss with a basic exercise, but then a friend gave me a hint and from that one single hint I could later solve a lot of different problems just because I got the idea / that way of thinking.

Anyways, I just have a few questions:

  • Can you recommend a book that's simple and easy? (I've been thinking to try Sedgewick's book, would you recommend it?).
  • Any tips? warnings?
  • Anything else you think I should know? (what would have you told yourselves at the beginning?)


Is This A Good Question/Topic? 0
  • +

Replies To: Trying to get started with algorithms

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10558
  • View blog
  • Posts: 39,064
  • Joined: 27-December 08

Re: Trying to get started with algorithms

Posted 28 December 2012 - 02:55 PM

Algorithms really get into a lot of math. Take a proofs class, and a Discrete Math class if you have room. Rosen's Discrete Math book is a good one to pick up. Johnsonbaugh's book is very technical, and Epp is a little more friendly I think. This should help you to pick up some formal math, as well as get into important topics like some basic number theory and set theory. Proof by Induction and Big-O are also two important topics. Regarding recursion, I have a good tutorial on recursion, stacks, and trees.

Also, if this is your first time delving into algorithms, you might find it helpful to look at an introductory Data Structures and Algorithms textbook (one that focuses on Linked Lists, stacks, queues, basics of trees, a little searching and sorting, maybe hashing) vs. a second or third semester data structures and algorithms textbook.
Was This Post Helpful? 0
  • +
  • -

#3 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7727
  • View blog
  • Posts: 13,049
  • Joined: 19-March 11

Re: Trying to get started with algorithms

Posted 28 December 2012 - 03:02 PM

My best advice is: don't try to teach yourself. It's not really difficult, but it's extremely complex. There are a lot of moving parts to keep track of for each idea, and you really need a good teacher here to get you on the right track. If there's any sort of community college or college or any such thing around, see if you can buy or blather or beg your way in. Being in a room full of people who are having the same confusions you are is surprisingly helpful, and it's even better if you're all having slightly different confusions.

As a distant second, Sedgewick is doing his algorithms course on coursera again in a few weeks. He's great, but he's behind a glass wall, and you can't get much out of watching him on TV. If there's absolutely nothing else you can do, that'll probably help, but don't expect it to substitute for even a mediocre community college professor who knows your name and follows your particular progress, and a room full of students that you can use to talk the material over after the class.

Sedgewick's book is good, and if you do the coursera course it's worth having (even though it's not required - which is an amazing failure of every coursera course I've seen so far) but it is not going to get you that much further than any other book.

Tips? Well, like any class, understand all of the code, do all the math, and ask a lot of questions. (oh, wait, you can't do that when the prof is on TV... damn)
Was This Post Helpful? 1
  • +
  • -

#4 pokiaka  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 76
  • Joined: 05-August 11

Re: Trying to get started with algorithms

Posted 28 December 2012 - 03:10 PM

I actually am planning to learn this at a classroom, but I always like to know the material a little bit ahead in my free time (pretty determined about it).

Do I need to know much about the various containers? (linked-lists, trees, etc.) or just knowing what they are is fine?

God, this subject really is complex.
But anyways, thanks, it's much appreciated!
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7727
  • View blog
  • Posts: 13,049
  • Joined: 19-March 11

Re: Trying to get started with algorithms

Posted 28 December 2012 - 03:16 PM

Yes, linked lists are usually the first real data structure you play with, and all of the node-oriented structures are basically variants on the linked list. You want to understand them.
Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10558
  • View blog
  • Posts: 39,064
  • Joined: 27-December 08

Re: Trying to get started with algorithms

Posted 28 December 2012 - 03:19 PM

Quote

Do I need to know much about the various containers? (linked-lists, trees, etc.) or just knowing what they are is fine?

What type of class is this? Intro to Data Structures, Data Structures II, or Algorithm Analysis (lots of math)?

You might benefit from checking out the Java Data Structures Resource Thread as well.
Was This Post Helpful? 0
  • +
  • -

#7 pokiaka  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 76
  • Joined: 05-August 11

Re: Trying to get started with algorithms

Posted 28 December 2012 - 03:28 PM

The class I mentioned will be an introduction to computer science (and algorithms is a part of it), but there's no way I'm not going to continue and take more courses about algorithms, recursion, and whatnot.. it's just so challenging, fun and damn powerful :)>.

And Jon, thank you, I'll get on it!

This post has been edited by pokiaka: 28 December 2012 - 03:29 PM

Was This Post Helpful? 0
  • +
  • -

#8 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10558
  • View blog
  • Posts: 39,064
  • Joined: 27-December 08

Re: Trying to get started with algorithms

Posted 28 December 2012 - 03:41 PM

The Data Structures resource thread is perfect then. You won't really be getting into more intense math until a second or third data structures course.
Was This Post Helpful? 0
  • +
  • -

#9 pokiaka  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 76
  • Joined: 05-August 11

Re: Trying to get started with algorithms

Posted 28 December 2012 - 03:44 PM

Oh that's awesome! many thanks!
(Still wonders why Java is always the language to learn those kind of stuff..)
Was This Post Helpful? 0
  • +
  • -

#10 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10558
  • View blog
  • Posts: 39,064
  • Joined: 27-December 08

Re: Trying to get started with algorithms

Posted 28 December 2012 - 03:50 PM

It's the predominant player in the industry. About ten years ago, C++ was the language of choice. A fair number of data structures courses are still taught in C++. This introductory course is still a point where students are new to programming, and Java tends to be a friendlier language to work with. Different people have varying opinions on which language should be taught, but learning Java won't hurt you. Especially when it comes to applying for jobs.
Was This Post Helpful? 0
  • +
  • -

#11 pokiaka  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 76
  • Joined: 05-August 11

Re: Trying to get started with algorithms

Posted 28 December 2012 - 04:00 PM

View Postmacosxnerd101, on 28 December 2012 - 03:50 PM, said:

It's the predominant player in the industry. About ten years ago, C++ was the language of choice. A fair number of data structures courses are still taught in C++. This introductory course is still a point where students are new to programming, and Java tends to be a friendlier language to work with. Different people have varying opinions on which language should be taught, but learning Java won't hurt you. Especially when it comes to applying for jobs.


Ah, always thought it'd be C#.
But good to know why it really is like that, before you said that it always baffled me.
Was This Post Helpful? 0
  • +
  • -

#12 mostyfriedman  Icon User is offline

  • The Algorithmi
  • member icon

Reputation: 727
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Trying to get started with algorithms

Posted 28 December 2012 - 06:46 PM

Try out the algorithm tutorials on topcoder, it will give you some introduction and basics. A good book that is easier to read than introduction to algorithms is The Algorithm design manual by Steven Skiena, try that out. A good background in math is needed in all cases however.
Was This Post Helpful? 0
  • +
  • -

#13 pokiaka  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 76
  • Joined: 05-August 11

Re: Trying to get started with algorithms

Posted 29 December 2012 - 02:25 PM

Thanks mostyfriedman.
I'll check that site out.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1