Let's try and take a different spin on yesterday's problem. Today's goal will be to implement a stack. Then using two instances of the stack you'll want to mimic the functionality of a queue. Thus your queue will have an enqueue and dequeue method but those methods will only use the push and pop functionality of your stacks.
Comments:
Kevin Benton - 10 years, 8 months ago
reply permalink
Adam - 10 years, 8 months ago
This one's a bit more efficient, it doesn't need to pour the stacks into each other on each deque:
reply permalink
Anonymous - 10 years, 8 months ago
"c suxx 2: eletric boogaloo"
I'm not going to try to solve this problems with C anymore.
reply permalink
Adam - 10 years, 8 months ago
Learning the state monad in Haskell:
reply permalink
Bill Bejeck - 10 years, 8 months ago
public class TwoStacks {
}
reply permalink