56

Can you recommend me a book or (better!) a site with many hard problems and exercises about data structures?

I'm already answering project Euler questions, but these questions are about interesting, but uncommon algorithms. I hardly used even a simple tree. Maybe there is a site with exercises like: hey, you need to calculate this: ... . Do it using a tree. Now do it using a zipper. Upload your C (Haskell, Lisp, even Pascal or Fortress go) solution. Oh, your solution is so slow!

Self-education is very hard then you trying to learn very common, fundamental things. How can I help myself with them without attending to courses or whatever?

Valentin Golev
  • 9,823
  • 9
  • 58
  • 80

10 Answers10

26

Introduction to Algorithms, Third Edition, by Cormen, Leiserson, Rivest and Stein is a good intro to algorithms and data structures. It has many exercises at the end of each chapter. most of them are simple, but there are some more difficult.

josliber
  • 43,000
  • 12
  • 95
  • 132
Ofri Raviv
  • 23,474
  • 3
  • 53
  • 54
  • 1
    The classic! Knuth's books are also good, but I tend to find CLRS less verbose and more in-depth in some places. – San Jacinto Feb 21 '10 at 14:08
  • 1
    raviv which programming language they are using in the CLRS book 3 edition. thank you in advance – ob_dev Jun 17 '11 at 17:16
  • 2
    @oussama - They use pseudocode, not any specific programming language, because algorithms and data structures are mostly language agnostic. – Ofri Raviv Jun 18 '11 at 06:33
20

Video lectures by National Programme on Technology Enhanced Learning(NPTel) at NPTEL Youtube channel. These are being carried out by seven IITs and IISc Bangalore of India and funded by MHRD, Govt of India.

Many more engineering lectures.

ankitjaininfo
  • 11,206
  • 7
  • 50
  • 74
  • I prefer using ClipMine to get tagged video lectures. https://www.clip.mn/search/?q=%23nptelhrd+algorithms&search_type=clipmine – Manas Paldhe Oct 13 '15 at 22:00
14

Awesome free eBook — «Data Structures and Algorithms». Contains implementation of the common algorithms in pseudocode and in an explicit form. Besides, quite nice and intelligible schemes and graphics.

Even Jon Skeet mentioned that in his blog. :-)

In addition, this is less than 100 pages book (as you may know, lots of programmers don't read some books).

MiKo
  • 2,038
  • 1
  • 20
  • 29
  • I don't think this book made it past first edition - there's a few mistakes (e.g. http://stackoverflow.com/questions/11379467/how-does-this-bst-node-deletion-algorithm-work) but it is short and free. – Ben Feb 15 '14 at 21:39
  • 1
    the last link die if you would like to know. – VimNing May 13 '19 at 12:37
  • 1
    the first link die if you wouldn't like to know – VimNing May 14 '19 at 00:20
  • OK... the last check: your second link article not found no more message... – VimNing May 14 '19 at 00:22
10

This has to be a duplicate.

I'd recommend the MIT open courseware site here. There's algorithms courses in the "Electrical Engineering and Computer Science" section some way down the page.

6.006 - Introduction to Algorithms
6.046J - Introduction to Algorithms (SMA 5503)

I recommend the latter. The materials are on the site. The videos are probably best accessed from YouTube here - search for "mit algorithms". The textbook is well respected. Third edition is just out, second edition matches the course. The first edition was also included as part of Dr Dobbs Algorithms and Data Structures CD ROM.

Niklaus Wirth has an Algorithms and Data Structures book available for download from his personal site. I have the Modula 2 print version, and while it's not a a substitute for Cormen (or aho hopcroft ullman, etc) it's a nice book to have.

4

Apart from the aforementioned Cormen, Leiserson and Rivest, there is also a very new book by Peter Brass, "Advanced Data Structures". It has relatively ugly example code in C, and the author is somewhat fanatic about performance (for example, he doesn't use recursion), but the theoretical content of that book is brilliant and unique, it hardly intersects with Cormen. I expect it to become a classic.

jkff
  • 17,193
  • 3
  • 50
  • 84
3

http://www.youtube.com/watch?v=QMV45tHCYNI

CS 61B: Data Structures - Fall 2006

Instructor: Jonathan Shewchuk

Fundamental dynamic data structures, including linear lists, queues, trees, and other linked structures; arrays strings, and hash tables. Storage management. Elementary principles of software engineering. Abstract data types. Algorithms for sorting and searching. Introduction to the Java programming language.

Also you can read this book for Algorithms..

http://www.amazon.com/Data-Structures-Algorithms-Made-Easy/dp/1466304162

ashwinsakthi
  • 1,786
  • 4
  • 24
  • 56
3

If you want to practice, you can have a look at http://www.topcoder.com, they propose alorithm challenges.

thibr
  • 597
  • 5
  • 13
2

If you want an enlightening alternative for learning algorithms you can always try: Rabhi F., Lapalme G. Algorithms.. a functional programming approach.

The authors challenge more traditional methods of teaching algorithms by using a functional programming context, with Haskell as the implementation language. This leads to smaller, clearer and more elegant programs which enable the programmer to understand the algorithm itself more quickly and to use that understanding to explore alternative solutions. Placing the emphasis on program development rather than the mathematical properties of algorithms, the book uses a succession of practical programming examples to develop in the reader problem-solving skills which can be easily transferred to other language paradigms.to other language paradigms.

As for a site with (hard) exercises you can always try to solve, I recommend: spoj .

Andrei Ciobanu
  • 12,164
  • 22
  • 80
  • 116
1

Additional to the really good text book Introduction to Algorithms, Third Edition, by Cormen, Leiserson, Rivest and Stein, I would highly recommend to watch the online available videos of lectures given by Leiserson at MIT. If you have the book and the lectures, it is like you were studying at the MIT ;-)

http://videolectures.net/mit6046jf05_introduction_algorithms/

Nils Schmidt
  • 3,690
  • 6
  • 22
  • 28
0

A good text book with exercises at the end seems like the best way to go.

Pranav
  • 3,324
  • 8
  • 34
  • 46