Question: void readjustNetwork(int startIndex, int endindex); Manipulate next pointers to readjust the linked list. Here, startIndex is index of a node from starting. Similarly endindex is

 void readjustNetwork(int startIndex, int endindex); Manipulate next pointers to readjust the

void readjustNetwork(int startIndex, int endindex); Manipulate next pointers to readjust the linked list. Here, startIndex is index of a node from starting. Similarly endindex is index of a node from beginning. The function will send the chunk of the link list between start index and end index at the end of the linked list. Consider the node at head as index 0. For example, if you have linked list like this: "A -> B- C -> D -> E-> NULL", and startIndex=1 and endindex=3, then the linked list after readjustNetwork should be A -> E -> B -> C -> D-> NULL". If you have linked list like this: "A - B - C - D -> NULL", and startindex=0 and endindex=2, then the linked list after readjustNetwork should be "D-> A - B -> C -> NULL". Here, "D" is the new head. If the linked list is empty, print "Linked List is Empty". If endindex is bigger than the number of nodes in the linked list or smaller than 0, then print "Invalid end index". endIndex should be lesser than the index of the last element in the linked list. Otherwise print "Invalid end index". If startIndex is bigger than the number of nodes in the linked list or smaller than 0, then print "Invalid start index". If startIndex > endIndex print "Invalid indices". [NOTE: Change the order of the "node" (by manipulating the next pointers of each node), not the "value of the node"]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!