Lab 17 Using a linked list with an iterator Build a class called LinkedListRunner with a main method that instantiates a LinkedList. Add the following strings to the linked list: aaa qqq ccc ddd еее fff gg hhh iii Build a ListIterator and use it to walk sequentially through the linked list using hasNext and next, printing each string that is encountered. When you have printed all the strings in the list, use the hasPrevious and previous methods to walk backwards through the list. Along the way, examine each string and remove all the strings that begin with a vowel. When you arrive at the beginning of the list, use hasNext and next to go forward again, printing out each string that remains in the linked list.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE: The implementation of a queue in an array, as given in this chapter, uses the variable count to...
icon
Related questions
Question
100%
Lab 17 Using a linked list with an iterator
Build a class called LinkedListRunner with a main method that instantiates
a LinkedList<String>. Add the following strings to the linked list:
aaa
bbb
ddd
еее
fff
ggg
hhh
ii
Build a ListIterator<String> and use it to walk sequentially through the linked list
using hasNext and next, printing each string that is encountered. When you have printed all the
strings in the list, use the hasPrevious and previous methods to walk backwards through the list.
Along the way, examine each string and remove all the strings that begin with a vowel. When you
arrive at the beginning of the list, use hasNext and next to go forward again, printing out each string
that remains in the linked list.
Transcribed Image Text:Lab 17 Using a linked list with an iterator Build a class called LinkedListRunner with a main method that instantiates a LinkedList<String>. Add the following strings to the linked list: aaa bbb ddd еее fff ggg hhh ii Build a ListIterator<String> and use it to walk sequentially through the linked list using hasNext and next, printing each string that is encountered. When you have printed all the strings in the list, use the hasPrevious and previous methods to walk backwards through the list. Along the way, examine each string and remove all the strings that begin with a vowel. When you arrive at the beginning of the list, use hasNext and next to go forward again, printing out each string that remains in the linked list.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operations of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT