Stacks, Queues and Binary Trees