Question: Instructions Read the following instructions carefully before working on this assignment. 1. This is an individual assignment. You may discuss ideas, ask questions or explain

 Instructions Read the following instructions carefully before working on this assignment.

Instructions Read the following instructions carefully before working on this assignment. 1. This is an individual assignment. You may discuss ideas, ask questions or explain things to each other Nevertheless, you should solve the assignments independently 2. Submissions via email will not be accepted. The homework should be submitted via BBLearn by the due date 3. You should submit your own work. Material brought from elsewhere (e.g. the Internet2, a classmate submission at a previous offering...) is not acceptable 4. Submit on PDF file 5. A program that doesn't compile will earn zero points uestions [5 points] Question #1 What advantages do linked lists have over arrays? What disadvantages do they have? [ 10 points] Question #2 What does the following code print? Draw a picture of the linked list after each step LinkedLi st staff = new LinkedList (); staff.addFirst ("Harry") staff.addLast ("Diana") staff.addFirst ("Tom") System.out.println (staff.removeLastO) System.out.println (staff.removeFirst ) System.out.println (staff.removeLast )) //Step 1 //Step2 //Step3 //step 4 //step 5 //Step6 //step 7 Item Screen output of steps 5 to 7 Linked list picture after steps 1 to 7 Non-compilin Points rams [15 points] Question #3 What does the following code print? Draw a picture of the linked list including the iterator position after each step LinkedList staff new LinkedList /step 1 Listiteratorstring> iterator = staff. list Iterator(); //Step 2 iterator.add ("Tom"); iterator.add ("Diana" iterator.add ("Harry"); iteratorstaff.listIterator if (iterator.next ).equals ("Tom") //Step 3 //Step4 //Step5 //Step 6 (iterator.remove ) //step 7 while (iterator.hasNext )) System.out.println (iterator.next )) //Step 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!