Question: Programming Homework 1 ( Due Sun, 6 t h Oct 1 1 : 5 9 PM ) Q 1 . Write a generic node class,
Programming Homework Due Sun, Oct
: PM
Q Write a generic node class, whose data is an array, arr, of length The
array being of generic type The node class also maintains a variable which
is the amount of user data stored in arr. So the node is not storing one, but
storing data items as an array of type T yes, we can mix linked lists and
arrays
Q Write a generic tailed linked list, that uses this node class. Add the private
member variables needed. I need you to complete just one method of this tailed
linked list: addLast The method adds another data item to the linked list. It
adds another node, only if the last node is already full, else it just adds one entry
to the array in the last node. Handle the special case that the linked list is
empty, and you are adding the first item
Q Modify the stack implementation by arrays, as follows. Write a function:
resize This function is called from the pop function, if the length of user data
is smaller than of the total size of the array. Then this resize function is
called, that resizes the array by reducing the array size by a factor of That is
size int
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
