Hacker News new | past | comments | ask | show | jobs | submit login

Where are the data structures? [0]

    MIN := X[N]; k := N;
    for j := N-1 step -1 until 1 do
      if X[j] < MIN then
        begin MIN := X[j]; k := j;
        end;
[0] https://assets.cs.ncl.ac.uk/seminars/139.pdf



X


X is data. There is no defined structure to it apart from the fact that there are N elements and you can select them. Is it a linked list, is it a random access array? It is not yet defined to be structured in any way. Furthermore you can analyze (and implement) this algorithm independent of the assumptions you make about how the access operation is performed, and then add those assumptions back in if you want to do another analysis.


You seem to be disputing a bunch of statements nobody made; all was said was "algorithms are implemented with data structures", and that example fits - you need a data structure to implement that algorithm. That's all that was claimed.


> X is data. There is no defined structure to it apart from the fact that there are N elements and you can select them. Is it a linked list, is it a random access array? It is not yet defined to be structured in any way.

Sure, but then that's not the entire implementation, error: X is undefined. If you want to actually run that code, it needs to be one of those (or many other) things.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: