Question: In this lab, you have to implement functions for lists: During the class we considered the insert function within a class ( it was a
In this lab, you have to implement functions for lists:
During the class we considered the insert function within a class it was a method
We consider the class Node with the properties int data, Node next, and Node previous
Create a recursive function that insert an element in the list given as an input, where the list is only the pointer to the head.
Possibility : Node InsertNode head,int x Insert the element x in the list head, and return the new list
Possibility : void InsertNode head,int x Insert the element x in the list head, and change the list given as an input pointer
Possibility : void InsertNode &head,int x Insert the element x in the list head, and change the list given as an input reference
We consider a an array of size n containing integers
Create a function that returns a list l containing the unique values of a
Example: the array will return the list
Create a function that return a list l containing the occurrence of each element in a
Example: the array will return the list
Create a sorted list that returns all the elements from an array that are above a given element x
Example: the array and x the returned list is
Create a Stack or a Queue class the choice is yours using a list instead of an array, as seen during the class
Submit only questions in the same file, with a main that demonstrates each function.
code in c
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
