Skip to content

Files

Latest commit

Jul 24, 2019
a6278b7 · Jul 24, 2019

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 24, 2019
Jul 24, 2019

Implement a stack API using only a heap. A stack implements the following methods:

  • push(item), which adds an element to the stack
  • pop(), which removes and returns the most recently added element (or throws an error if there is nothing on the stack)

Recall that a heap has the following operations:

  • push(item), which adds a new key to the heap
  • pop(), which removes and returns the max value of the heap