Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void splice(QueueInterface firstQueue, QueueInterface secondQueue) {
- QueueInterface store = new ArrayQueue();
- while(!secondQueue.isEmpty()) {
- firstQueue.enqueue(secondQueue.getFront());
- store.enqueue(secondQueue.dequeue());
- }
- while(!store.isEmpty()) {
- secondQueue.enqueue(store.dequeue());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement