Question: 1 Dynamic Memory Allocation and Linked Lists For this question, your job is to implement a SINGLY Linked list. This linked list will be built

 1 Dynamic Memory Allocation and Linked Lists For this question, your

1 Dynamic Memory Allocation and Linked Lists For this question, your job is to implement a SINGLY Linked list. This linked list will be built by taking SINGLE CHARACTER inputs from the user, one input at a time, and placing the input in respective nodes. Every node will have a character specified by user input AND an address. The address will be pointing toward the next node in the linked list. You will then develop a procedure to print the linked list you have made, along with a procedure to reverse said linked list. Use whichever subroutines vou like. Follow convention (a) Write a procedure called "build" that will continually ask the user for another input UNTIL the user has input the character "*". "*" Will act as the token that signifies that the list is complete. The final "*" will not be considered a part of the linked list. For EACH user input until "*", you will put that character into a single node in the linked list. Svl will be used to return the address of the first node in the linked list (b) Write a procedure called "print" which will use $a0 to take the address of the first node of a linked list. "print" will print the contents of each node as it goes through the linked list. (c) Write a procedure called "reverse" which will reverse a singly linked list. Reverse will take the first node of a linked list as an argument. Pass the address of the first node of a linked list through $al. Reverse will then reverse every element in the linked list. Return the reversed linked list in Svl. Use whichever subroutines you like. Follow convention

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!