Answered You can hire a professional tutor to get the answer.

QUESTION

(10pts) Write a function set(int* a, int val) that sets the value of an integer a declared in the calling function, to the value val.

1. (10pts) Write a function set(int* a, int val) that sets the value of an integer a declared in the calling function, to the value val. Print the value of the integer from the calling function both prior to and after calling the set function.

2. (10pts) Write the function swapInts(int*, int*) that swaps the values of two integers. From the calling function, print the values of two pointers before and after the swap.

3. (10pts) Write the function swapPtrs(int**, int**) that swaps two pointers. From the calling function, print the values of the two integers before and after the swap.

4. (10pts) Implement a singly-linked list of integers. Write the function findNthElement(struct listnode* head, int N) which returns the Nth element of the list. Print the contents of your list and the value of the Nth element on separate lines.

5. (10pts) Implement a singly-linked list of integers. Write the function removeNthElement(struct listnode* head, int N) which removes the Nth element of the list. Print the contents of the list before and after removal of the Nth element.

6. (10pts) Implement a singly-linked list of integers. Write the function findNthToLastElement(struct listnode* head, int N) which returns the Nth element counting from the END of the list. Print the contents of the list as well as the Nth to last element on separate lines

7. (10pts) Implement a doubly-linked list. Write the function reverse(struct listnode** head) which reverses the list by swapping the previous and next pointers of each node. Print the contents of the list before and after the reversal.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question