Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public class Subset
  2. {
  3.  
  4. public static void main(String[] args) {
  5. RandomizedQueue<String> queue = new RandomizedQueue<String>();
  6. int k=Integer.parseInt(args[0]);
  7. for (int i=0; !StdIn.isEmpty(); i++){
  8. queue.enqueue(StdIn.readString());
  9. }
  10.  
  11. for (String s : queue){
  12. if (k-- == 0) break;
  13. StdOut.println(s);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement