Commit 9de49155 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Explain amortized cost for Stack.push in documentation

parent 360317ec
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment