5 ms·
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;
by riboflava 10y ago
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 https://assets.cs.ncl.ac.uk/seminars/139.pdf
- icebraining 10y agoX
- deleted 10y ago[deleted]
- riboflava 10y agoX 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.
- icebraining 10y agoYou 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.
- squeaky-clean 10y ago> 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.