-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: update List.mo
#616
doc: update List.mo
#616
Conversation
Fix bugs is doc comments
@@ -169,7 +169,9 @@ module { | |||
/// | |||
/// Runtime: O(size) | |||
/// | |||
/// Space: O(1) | |||
/// Space: O(size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the linear size originate from any (internal) temporary allocations during the iterative iteration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not really sure how to document this. Should it just be 0(1)? If the function allocates non-zero constant space, then I think iterating it should allocate linear space (if the space is retained).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about O(space(f))
?
(was just passing by...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvement. This looks very good.
I only have a question regarding the documented size of iterate()
.
Fix bugs is doc comments