Each of the functions in queue_from_stacks.c has a function header comment that describes more precisely how it should behave. The interface of your queue-from-stacks is defined in queue_from_stacks.h, and you must complete each of the functions implementing the queue-from-stacks in queue_from_stacks.c. ![]() For the second part of this assignment, you will use two instances of this stack data structure to implement a queue. In the files stack.h and stack.c, a simple stack data structure is implemented. Importantly, you must perform the list reversal in place and may not allocate any new memory in this function. This function is prototyped in list_reverse.h, and you will implement it in list_reverse.c. For this part of the assignment, you will implement a function called list_reverse() that takes as an argument a single link structure representing the head of a linked list, reverses that list, and returns the new head of the reversed list. In link.h, a simple structure implementing a link in a singly-linked list is defined. Implement a function to reverse a linked list in place In addition to the descriptions below, there is thorough documentation in these files describing how each function should behave. In this assignment, your work will be limited to the files list_reverse.c, queue_from_stacks.c, and stack_from_queues.c, where you will implement the functions described below. Feel free, however, to write any additional functions you need to accomplish the tasks described below. If you change the prototypes, it will cause the unit tests to break, and your grade for the assignment will likely suffer. ![]() To help grade your assignment, we will use a set of unit tests that assume these functions exist and have the same prototypes that are defined in the starter code. It's important that you don't modify the function prototypes. ![]() There are several parts to the assignment, each described below.įor this assignment, you are provided with some starter code that defines the structures you'll be working with and prototypes the functions you'll be writing. This assignment is intended to have you start working with stacks, queues, and linked lists.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |