The data structure developed for program 1 does not identify an indexOf method. This useful tool reports back the List index of the first item it finds that matches its input parameter. If it is not present in the List, the method returns -1. Write the indexOf method. You may (and should) use any of the public methods identified in the List interface under program 1 in your solution. Use Example: int main(){ List myList = new LinkedList({1,2,3,4,5,7, 9}); « myList.index0f(4) 11 std::cout < "Index of 4: << std::endl; « myList.index0f 11 std::cout < "Index of 310: (310) << std::endl; } Output: -1

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 18RQ
icon
Related questions
Question
The data structure developed for program 1 does not
identify an indexOf method. This useful tool reports back
the List index of the first item it finds that matches its
input parameter. If it is not present in the List, the method
returns -1.
Write the indexOf method. You may (and should) use any
of the public methods identified in the List interface
under program 1 in your solution.
Use Example:
int main(){
List<int> myList
= new LinkedList({1,2,3,4,5,7,
9});
« myList.index0f(4)
std::cout << "Index of 4:
<< std::endl;
std::cout << "Index of 310:
(310) << std::endl;
%3D
<« myList.index0f
Output:
-1
Transcribed Image Text:The data structure developed for program 1 does not identify an indexOf method. This useful tool reports back the List index of the first item it finds that matches its input parameter. If it is not present in the List, the method returns -1. Write the indexOf method. You may (and should) use any of the public methods identified in the List interface under program 1 in your solution. Use Example: int main(){ List<int> myList = new LinkedList({1,2,3,4,5,7, 9}); « myList.index0f(4) std::cout << "Index of 4: << std::endl; std::cout << "Index of 310: (310) << std::endl; %3D <« myList.index0f Output: -1
The data structure developed for program 1 does not
identify a reverse method. This method totally inverts the
order of every item the list. The back of the line becomes
the front of the line. Write the reverse method. You may
(and should) use any of the public methods identified in
the List interface under program 1 in your solution.
Edit View
Insert
Format Tools Table
12pt v
Paragraph v :
Transcribed Image Text:The data structure developed for program 1 does not identify a reverse method. This method totally inverts the order of every item the list. The back of the line becomes the front of the line. Write the reverse method. You may (and should) use any of the public methods identified in the List interface under program 1 in your solution. Edit View Insert Format Tools Table 12pt v Paragraph v :
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT