Skip to content
Snippets Groups Projects
Commit 9de49155 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Explain amortized cost for Stack.push in documentation

parent 360317ec
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment