Answered You can hire a professional tutor to get the answer.

QUESTION

CSCI 15, Lab Assignment 8 Due 11/28/2018, 15 Points Linked List A data structure is a software "construct" that allows data to be stored, retrieved and accessed in a particular manner. Individually st

CSCI 15, Lab Assignment 8 Due 11/28/2018, 15 Points Linked List A data structure is a software "construct" that allows data to be stored, retrieved and accessed in a particular manner. Individually stored data is called a "node". Capabilities include: . Adding new data elements either in front or back of the data structure . Changing values in existing nodes . Finding a particular node based on a value Display the contents of the data structure (front to back or back to front) A linked list allows an "'unlimited" number of nodes using pointers (this is NOT an array nor is it a vector). 1. 2. Store an integer value in the nodes Add a node (allow user to add a node either in front or append in back of the linked list, we will keep this "simple"). Since we are using pointers, the list can be potentially "unlimited" in size and number of nodes Display the value (front to back AND back to front) 3. You might wish to present the user interface as a "menu" with one option as "Quir" (end this application). Allow user to run this as many times as they wish. You have got to keep track in the node of several data items as well as in the application: Pointer to the previous node location of this list in memory (first node in list has nothing in front hence NULL) Data Element (integer in this case, but can this be expanded?) Pointer to the next node location of this list in memory (last node in list has nothing in back hence NULL) Since the node has to keep track of several data items, it would have to be a "struet" The pointers would have to be of that user defined "data type" Keep track of the number of nodes (every time you add a node) Keep track in memory of where the First Node and Last Node memory locations The command "new" creates a new memory location (ie, p-new Numbers) . . . · Add a Node to the front: 1. If there are NO nodes in the list: a. Create a new node b. Set the First to its memory location c. Set its Previous and Next to NULL d. Set the value for the data element e. Set a memory pointer to keep track of where it is (i.e. the First node and the Last node) You might want to keep track of how many nodes you have (ie, every time you add a node) E

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question