News for hackers. Stuff that matters.
Re:Ask YC: Data structure or Algorithm selection for a problem? by cperciva on Wednesday December 19, 2007 @09:29PM (#91371)
To quote Hofstadter: Mu.

Particular algorithms operate on particular data structures; a binary search on a sorted list makes sense, while a binary search on an unsorted list is meaningless. It doesn't make any sense to have one of "a good algorithm" or "a good data structure" without the other.

Re:Ask YC: Data structure or Algorithm selection for a problem? by yearsinrock on Thursday December 20, 2007 @03:20AM (#91437)
I think this reply perfectly answers my question.
Re:Ask YC: Data structure or Algorithm selection for a problem? by boucher on Thursday December 20, 2007 @03:24AM (#91438)
Good introductory text: Cormen/Leiserson/Rivest/Stein: Introduction to Algorithms (2nd edition)

http://www.amazon.com/Introduction-Algorithms-Thomas-H-Corme...

Good advanced text: Jon Kleinberg/Eva Tardos: Algorithm Design

http://www.amazon.com/Algorithm-Design-Jon-Kleinberg/dp/0321...

Re:Ask YC: Data structure or Algorithm selection for a problem? by bayareaguy on Thursday December 20, 2007 @01:50AM (#91411)
I suggest you read "Algorithms + Data Structures = Programs" by Niklaus Wirth. http://tinyurl.com/yw7tgo
Re:Ask YC: Data structure or Algorithm selection for a problem? by aristus on Wednesday December 19, 2007 @11:24PM (#91395)
Mooooo..... :)

I usually visualize the data structure that exists, or that I want, and work "backwards" from there. But whichever direction you use, always always remember that the idea is to make the design simpler and more clear.

Re:Ask YC: Data structure or Algorithm selection for a problem? by boucher on Thursday December 20, 2007 @03:19AM (#91436)
Well, no, not always, always.

Use the data structure that makes the design more efficient. Clarity might be nice, but an O(n) solution is not acceptable when a reasonable O(log n) or O(1) solution exists.

Re:Ask YC: Data structure or Algorithm selection for a problem? by z0ltanz0ltan on Thursday December 20, 2007 @02:37AM (#91424)
At all the above maniacs ... I think what yearsinrock meant was "Data Structure and Algorithm" selection for a specific problem...
Re:Ask YC: Data structure or Algorithm selection for a problem? by cperciva on Thursday December 20, 2007 @02:47AM (#91427)
That was my first thought based on the thread title, but it doesn't quite fit with the text "data structure or algorithm which one is more important in solving a problem" which follows.
Re:Ask YC: Data structure or Algorithm selection for a problem? by flashgordon on Thursday December 20, 2007 @01:09AM (#91408)
I didnt think that choice was orthogonal?