Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions

Question

1. How might volunteering help the employer and the employee?

Answered: 1 week ago