Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(!value.isEmpty()){ // loop is running untill the QUEUE value is empty
- int n = value.remove(); //insert the removing value into n
- s.add(n); // Store the removing value into new QUEUE s
- System.out.println(n);//prints the elements of a queue of integers, one per line.
- }
- while(!s.isEmpty()){ // NEW QUEUE is running untill it's getting empty
- int k = s.remove(); //Insert the removing value into k
- value.add(k); // string the element into value
- }
- System.out.println("QUEUE STILL CONTAIN THE SAME VALUE = "+value);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement