Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you want a better data-structure you must ask: Better for whom? Better for the algorithm that manipulates the data!

So I don't think that "data dominates". You may need to adapt your data to the algorithm or vice versa. What dominates is what we want to do. Without algorithm we are doing nothing.

In a sense data is part of the algorithm, it is implicitly coded into the assumptions the algorithm makes about its arguments and results.



On the other hand, algorithms are just data. In the end it's just a set of bytes that determines what happens to other sets of bytes. Data structures and algorithms are two sides of the same thing. In the abstract meaning space in our minds, data structures are an extension of the algorithm's logic. In the memory space, algorithms are just data structures that change other data structures.

Seeing the connection from both sides is insightful.


Yes. But there is a difference between data and program. Program is data as you say but it must be data that can be interpreted as a set of possibly conditional steps. It is often pointed out that Lisp programs are "just data" but not every list can be executed as a function.

Further programs are what interpret data, by making branching decisions based on the data. Program must be interpreted by the language interpreter, and then on the 2nd level the interpreted program interprets the data.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: