Question: This is c++ programming #inc Ludelost ream> using namespace std; /* General instructions: Please modify this file and submit the modified one via svn and
This is c++ programming


#inc Ludelost ream> using namespace std; /* General instructions: Please modify this file and submit the modified one via svn and then websubmission (under the entry "pracExam" No design documents are needed struct Node f int data; Node* next; /* Task 1: Implement the following function for adding a new node to the front of the given list input Nodes* head: a head pointer to a list int val: an integer that represent the value of the new node return the head pointer of the new list after the insertion Example: add a node of value 9 before after HEAD->1-2-3-NULL HEAD->9?1?2?3->NULL Node add (Node* head, int val)f /* Task 2: Implement the following function for printing the elements in odd position of the given list. Assume the head node is defined to be in position 1 input Nodes* head: a head pointer to a list return void output The elements in odd position of the given list Example: input HEAD->1?2?3?9?12--NULL output HEAD->1->NA->3->NA->12-NULL void printOdd (Nodex head)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
