Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Informatik 8
CoPaR
Commits
9de49155
Commit
9de49155
authored
Oct 17, 2018
by
Hans-Peter Deifel
Browse files
Explain amortized cost for Stack.push in documentation
parent
360317ec
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Data/Stack.hs
View file @
9de49155
...
...
@@ -95,7 +95,9 @@ clear s = writeSTRefU (tos s) 0
-- | Insert a new element on top of the stack.
--
-- Runtime: O(1)
-- This will reallocate the underlying memory if needed.
--
-- Runtime: Amortized O(1)
push
::
VM
.
Unbox
a
=>
Stack
s
a
->
a
->
ST
s
()
push
s
x
=
do
currentTos
<-
readSTRefU
(
tos
s
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment