Reference no: EM13333152
1) Write a function 'CheckSmaller' that takes two linked list as input arguments. These linked list contain numbers like this:
num1->3->5->2->NULL (this linked list represents a decimal number 352)
num2->4->3->9->1->NULL (it represents a decimal number 4391)
The function CheckSmaller should return 1 if num1 points to a linked list which represents a smaller number than the number pointed to by num2 linked list. Otherwise, it returns -1. If both linked list point to exactly the same number, CheckSmaller returns a 0.
int CheckSmaller(Node* num1, Node* num2);
For example, if two linked lists are:
num1->8->4->2->NULL (assuming that number 1 is 842) and
num2->8->4->3->NULL (assuming that number 2 is 843)
then your function should return 1 since 842 is smaller than 843.
2) Write a function 'Max' that takes an int array and the size of the array as input and returns the largest element of the array. The function should look like the following:
int Max(int a[], int size);