Advertisement
IstiakFahim

Untitled

Jun 17th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. while(!value.isEmpty()){ // loop is running untill the QUEUE value is empty
  2. int n = value.remove(); //insert the removing value into n
  3. s.add(n); // Store the removing value into new QUEUE s
  4. System.out.println(n);//prints the elements of a queue of integers, one per line.
  5. }
  6.  
  7. while(!s.isEmpty()){ // NEW QUEUE is running untill it's getting empty
  8.  
  9. int k = s.remove(); //Insert the removing value into k
  10.  
  11. value.add(k); // string the element into value
  12.  
  13. }
  14. System.out.println("QUEUE STILL CONTAIN THE SAME VALUE = "+value);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement