Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need to be answered correctly. You must: Comment and Format and Must make sure a

ID: 3728693 • Letter: N

Question

Need to be answered correctly. You must: Comment and Format and Must make sure about indenting. If you don't follow these steps, it will be flagged for review. MUST BE IN JAVA FORMAT. IT IS A MUST. Please also check the output very carefully. Must not provide the answer on a page. Use the Java compiler. Please provide the code in such a way so that it can be copied and checked in the Java compiler.

Need to be answered correctly. You must: Comment and Format and Must make sure about indenting. If you don't follow these steps, it will be flagged for review. MUST BE IN JAVA FORMAT. IT IS A MUST. Please also check the output very carefully. Must not provide the answer on a page. Use the Java compiler. Please provide the code in such a way so that it can be copied and checked in the Java compiler. Must provide: Node.java, LinkedList.java, LinkedListDemo1.java. Must not be under any package. Should be in imported format.

1A: Add the following method to LinkedList.java. Method public void printEvenIndex ) that prints the contents of all the nodes with even indices (assume the first node starts at index 0). For example, for the list shown below, the method should display TT 0 Test your method by including appropriate test statements to your demo program. 1B: Add the following method to LinkedList.java. Method public void printAllNodesWith(String d) that prints the indices of all the nodes that have the String d in them (assume the first node starts at index 0). For example, for the list shown below, 0 the method listAllNodes With(T") should print 02 Test your method by including appropriate test statements to your demo program.

Explanation / Answer

I created 3 classes LinkedList.java, Node.java and Demo.java , Demo.java contains main method which is testing

all the methods , below is simple output , So I wrote test methods for each, If you want more test caseses then you can simply ananyse my test cases and you can write your own test cases.

******************************************************************************

Sample Output:

Printing all even indexes, output: T->T->
T->T->
Its output should be: 1
1
Its output should be: 0 2
0 2
Its output should be: 3
3
All even index elements: output: T->S->T->
T->S->T->

***************************************************************

Please copy below classes to the same directory or same package and execute Demo.java

**************************************Node.java*********************************

*************************LinkedList.java*******************************************

**********************************Demo.java***************************************

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote