Skip to content

Latest commit

History

History
23 lines (12 loc) 路 295 Bytes

stack.md

File metadata and controls

23 lines (12 loc) 路 295 Bytes

Stack

Stack

LIFO (Last In First Out)

#stack

Stack implementations and insert/delete complexity

  • Linked list with a pointer on the head

Insert: O(1)

Delete: O(1)

  • Array

Insert: O(n), amortized time O(1)

Delete: O(1)

#complexity #stack