View the step-by-step solution to:

In lab final exam ideas Following are the possible topics for the in- lab final exam for next week . These all assume that we have struct Node int...

need help for in lab final exam. program should be in c++. Screen Shot 2018-11-30 at 10.26.23 PM.pngScreen Shot 2018-11-30 at 10.26.15 PM.pngScreen Shot 2018-11-30 at 10.25.59 PM.png

Screen Shot 2018-11-30 at 10.25.59 PM.png

In lab final exam ideas
Following are the possible topics for the in- lab final exam for next
week . These all assume that we have
struct Node
int data
Node * Next
and in main we have
Node * Head = NULL
pointer to the head of the list
Node * Temp
Used to get new nodes
We will also provide for you the code that is used to create the list and the
code to traverse and display the list elements . You can assume that the
first node on the list is the Oth node , the second node is node 1 , and so
on . You can also assume the list already exists and has 7 elements in it
( nodes O through node 6 ) with both even and odd numbers . For the
examples below , assume the list we are starting with is the list
2 - >3 - >5 - 6 - 8 - 9 - 1 1
The ideas are
1 . Split a list at the node with a designated value , using function
splitlist ( Node * Original int split value , Node * &p HeadA , Node
* Sep HeadB )
Enter the value to split the list : 6
Resulting lists are
2 - >3- >5 -1
8 - 9 - 1 1

Screen Shot 2018-11-30 at 10.26.15 PM.png

2 . Traverse a list , creating two new lists : One with all the even values , and
the other with all the odd values
even Odd Lists ( Node * Original Node * &p HeadEven , Node
* Sep Head Odd )
Resulting lists are
2 - 6 - 8
3 - 5 - 9 - 1 1
Delete all the list nodes that contain even numbers
new OddList ( Node * Ap Head )
Resulting list is
3 - 5 - >9 - 1 1

Screen Shot 2018-11-30 at 10.26.23 PM.png

4 . Insert listB into the middle of listA after the list value n . We start with
pListA is : 2 - > 3 - 9 - 1 1
plist Bis : 5 - 6 - 8
Insert List ( Node * pListA Node * pListB int insertValue )
Resulting lists is
2 - >3 - >5 - 6 - 8 - >9 - -1 1
5 . A list has two sections : section A is the part up until the node with value
n , and section B is the part after that . Swap sections A and B
Original list : 2 - 3 - 5 - 6 - 8 - 9 - 1 1
swap List Sections ( Node * Head , int swap Value ) swap Value is 5 in this
case
First list part : 2 - 3 - 35
Second list part : 6 - 8 - 9 - 11
New list : 6 - 8 - >9 - 1 1 - >2 - >3 - 5

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question