Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create a Random instance that will generate random numbers
- Random rand = new Random();
- // Create the Deque which in this case is an instance of LinkedList
- ArrayList<Integer> list = new ArrayList<>();
- // Push 10 random integers into the list.
- for (int i = 0; i < 10; i++)
- {
- list.add(rand.nextInt(10));
- }
- // Print the full array so we know the values
- System.out.println(list.toString());
- // Start here...
- Deque<Integer> deque = new LinkedList<>();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement