Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your assignment is as follows: create 2 LinearNode reference variables called list and sortedList, which will be pointers to the first node in 2 linked
Your assignment is as follows:
- create 2 LinearNode reference variables called list and sortedList, which will be pointers to the first node in 2 linked lists of LinearNode objects
- you will need other LinearNode reference variables (you figure out which ones)
- use a random number generator to add (the same) 10 numbers between 1 and 100 inclusive to list and sortedList
- for list - add the numbers so that the first number is at the beginning of the list, the second number is second in the list, the last number generated is at the end of the list
- for sortedList - you must add the numbers so that the numbers in the list are always sorted from lowest at the beginning to highest at the end
- after each number is placed in the 2 lists write out the entire contents of each list to verify that each list is correct
Your assignment is as follows:
- create 2 LinearNode reference variables called list and sortedList, which will be pointers to the first node in 2 linked lists of LinearNode objects
- you will need other LinearNode reference variables (you figure out which ones)
- use a random number generator to add (the same) 10 numbers between 1 and 100 inclusive to list and sortedList
- for list - add the numbers so that the first number is at the beginning of the list, the second number is second in the list, the last number generated is at the end of the list
- for sortedList - you must add the numbers so that the numbers in the list are always sorted from lowest at the beginning to highest at the end
- after each number is placed in the 2 lists write out the entire contents of each list to verify that each list is correct
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started