Question: Given an incomplete C++ code segment below, using a concept of doubly linked list: struct Node { int weight; Node *front, back; }; int main()

Given an incomplete C++ code segment below, using a concept of doubly linked list: struct Node { int weight; Node *front, back; }; int main() { Node +n = new Node(); //incomplete program } a) Complete following code segment to insert a new node to an existing linked list before the last node (insertion of 3rd node onwards). [7 marks) b) Display the average weight. [6 marks] c) Delete a second last node in a doubly linked list with n records. (5 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
