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 - 11 years ago
reply permalink
Adam - 11 years 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 - 11 years ago
"c suxx 2: eletric boogaloo"
I'm not going to try to solve this problems with C anymore.
reply permalink
Adam - 11 years ago
Learning the state monad in Haskell:
reply permalink
Bill Bejeck - 11 years ago
public class TwoStacks {
}
reply permalink