cs2110 hw2q2 - you pop from the main. You can read the min...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
2. Have two stacks. When you push to the main stack, also push to the second stack a value which is the min (the new value, the top of the second stack). Pop from the second stack when
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: you pop from the main. You can read the min of the main stack by reading the top value of the second stack....
View Full Document

Ask a homework question - tutors are online