You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 26, 2024. It is now read-only.
Can the runtime of List.length be added to the Remarks section of its documentation?
The standard implementation for a linked list would have linear runtime, but maybe F#'s list caches the length in the "head node" so that a constant runtime is possible. Since F#'s list is immutable, this is a textbook example of a time-space tradeoff: either choice has advantages over the other.
I briefly looked at the F# code to see if I could determine for myself what the implementation (and thus runtime) is. If someone wants to "teach me how to fish" in addition to "giving me a fish", that too would be greatly appreciated.