Hacker News new | ask | show | jobs
by WickyNilliams 4113 days ago
Um... isn't this a data structure not an algorithm?
1 comments

Programs = Data Structures + Algorithms, and it is often the case that there are deep relationships between the data structures and the algorithms.

For example, any linear recursive algorithm that deals with the head of a list and the tail/rest/butHead of a list is optimized for a linked list implementation. So... to understand a linked list, you really need to be familiar with algorithms that bisect list sin this manner, and the reverse: To understand algorithms that bisect lists in this manner, you have to be familiar with a linked list.

So... Yes it’s a data structure, but it’s joined at the hip to the algorithms that operate best on it.

I know, I was intentionally curt in my reply because snark is best solved with more snark </snark>