Refer to the code fragment below and convert the following Queue
structure into a Stack structure. You should create a reference
called S1 for the stack structure.
Code:
Queue Q1 = new LinkedList ();
Q1.add(“Sandra”);
Q1.add (15);
Q1.add (200);
Q1.add (‘# ‘);
Q1. remove ();
System.out.println(Q1);
System.out.println(Q1.peek());
Q1.add(“Mary”);
System.out.println(Q1);
Refer to the code fragment below and convert the following Queue structure into a Stack structure. You should create a r
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Refer to the code fragment below and convert the following Queue structure into a Stack structure. You should create a r
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!