Is this C exam doable?
Hello everyone! So i'm a first year software engineering student (already studied 2 years of common core where I studied C programming and data structures), tomorrow I have my final exam for data structs with C and I would like your opinion on these problems and if they're doable with paper and pen in just 2 hours or if I'm dogshit at data structures lol.
So the first problem is a linked list that contains integers, we want to transfer the cells of the list into a queue and a stack at the goal of reprinting the content of the stack and queue in ascending order. I have to give the used structures, explain the principle adopted and give the algorithm then write out the C function for transferring the cells, then write out a function that prints the elements of the stack and queue in ascending order. (I already did this but I had to write out another function that inserts elements in sorted order into the queue, which according to my prof is not very judicious and somehow I should use the stack to order the elements in the queue? with the stack still containing elements? (this is only 4 points out of 20.)
The second problem seemed overly complicated for no reason, it's a linked list implementation with a 2D array. the representation of elements of the list on the array is not necessarily continuous. The head of the list is not necessarily at the beginning of the array. The first dimension of the array contains either the information at said index or a link indicating the index of the following cell. The second dimension indicates if the case of the array is free, occupied, or a link to the following cell, or signals that it's the last element of the list. I have to illustrate this representation with a figure with explanations, write the function print_list_2d that prints the list, a function insert_head_list_2D, insert_queue_list_2D, insert_pos_list_2D that inserts at a position in the list. Personally I am pretty used to linked lists and love manipulating them but only using pointers. This problem with arrays is pretty overwhelming, if I see this problem for the first time in an exam it would take me at least 1 hour to just understand the concept enough to implement manipulation functions like asked. (this is 6 points out of 20)
Now for the third problem and the most challenging in my opinion; we will consider a structure composed of a binary search tree and an integer indicating the number of elements in said tree. I need to write out the structure, and define a function insert_integer(tree * root, int val) which is pretty simple but the rest is pretty challenging. The latter struct is put in a linked list, for each element of the linked list there's at most 5 elements for each bst, so pretty much a linked list of binary trees? I need to give the adopted structure, define a function that prints the elements of this list so it's sorted, explain the principle adopted for the insertion, and define a function that inserts an integers into this list of bst's so the order is maintained and in the right position, and then a function that removes an integer from the struct while maintaining order. (this is 10 points out of 20)
What do you guys think about these problems? Are they even doable in pen and paper? And do you guys have any tips or resources to help me so I can pass these types of exams? Thank you very much.