JAVA CODE PLEASE 2. Linked List Quiz by CodeChum Admin Write a function printNodes that takes in the head of a linked list and prints all the values of that linked list using a while loop. Print the values separated by a [space]->[space] Create a program that accepts 10 integer inputs. Assign each input into a node and link them in ascending order then print the linked list. Create another two linked lists: One for nodes with even numbers and the other one for odd numbers. Print them respectively using the printNodes function. Input 1. One line containing an integer 2. One line containing an integer 3. One line containing an integer 4. One line containing an integer 5. One line containing an integer 6. One line containing an integer 7. One line containing an integer 8. One line containing an integer 9. One line containing an integer 10. One line containing an integer Output Enter·number·1:·1 Enter·number·2:·2 Enter·number·3:·3 Enter·number·4:·4 Enter·number·5:·5 Enter·number·6:·6 Enter·number·7:·7 Enter·number·8:·8 Enter·number·9:·9 Enter·number·10:·10 All·nodes: 1·->·2·->·3·->·4·->·5·->·6·->·7·->·8·->·9·->·10 All·even·nodes: 2·->·4·->·6·->·8·->·10 All·odd·nodes: 1·->·3·->·5·->·7·->·9

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
icon
Related questions
icon
Concept explainers
Question
JAVA CODE PLEASE 2. Linked List Quiz by CodeChum Admin Write a function printNodes that takes in the head of a linked list and prints all the values of that linked list using a while loop. Print the values separated by a [space]->[space] Create a program that accepts 10 integer inputs. Assign each input into a node and link them in ascending order then print the linked list. Create another two linked lists: One for nodes with even numbers and the other one for odd numbers. Print them respectively using the printNodes function. Input 1. One line containing an integer 2. One line containing an integer 3. One line containing an integer 4. One line containing an integer 5. One line containing an integer 6. One line containing an integer 7. One line containing an integer 8. One line containing an integer 9. One line containing an integer 10. One line containing an integer Output Enter·number·1:·1 Enter·number·2:·2 Enter·number·3:·3 Enter·number·4:·4 Enter·number·5:·5 Enter·number·6:·6 Enter·number·7:·7 Enter·number·8:·8 Enter·number·9:·9 Enter·number·10:·10 All·nodes: 1·->·2·->·3·->·4·->·5·->·6·->·7·->·8·->·9·->·10 All·even·nodes: 2·->·4·->·6·->·8·->·10 All·odd·nodes: 1·->·3·->·5·->·7·->·9
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Types 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