Lab 12 : Linked Lists
August 3, 2020
Introduction
Check zyBook section 13.13. You will be given some driver code:
Step 1: (1 Point)
Make a class Node which has two parts the data part with is an integer and the pNext which is a pointer to the next node.
You have been given code to display the list look at the displayList Function.
Step 2: ( 1 Point)
Display the max of all numbers in the list. For this you have to write the getMaxOfAllNumbers(.....) function.
Look at the function call in main to know the return type and the parameters the function takes.
Step 3: (Extra Credit 1 Point)
Given three nodes delete the second node and return the data stored in it. Write the deleteSecondNode(...) function.
Check zyBook section 13.13. You will be given some driver code:
- code in main that takes new numbers and puts it into the linked list
- The tests surpass the main and call your functions directly.
Step 1: (1 Point)
Make a class Node which has two parts the data part with is an integer and the pNext which is a pointer to the next node.
You have been given code to display the list look at the displayList Function.
Running the code should look like: Enter list numbers separated by space, followed by -1: 3 5 7 -1 The list number values are: 7 5 3
Step 2: ( 1 Point)
Display the max of all numbers in the list. For this you have to write the getMaxOfAllNumbers(.....) function.
Look at the function call in main to know the return type and the parameters the function takes.
Running your program should look like this: Enter list numbers separated by space, followed by -1: 3 5 7 -1 The max of all numbers on the list is: 7
Step 3: (Extra Credit 1 Point)
Given three nodes delete the second node and return the data stored in it. Write the deleteSecondNode(...) function.
Running your program should look like this: Enter list numbers separated by space, followed by -1: 3 5 7 -1 Deleting second node. The data of the second node is: 5 The list number values are: 7 3