Write a recursive version of an array-based linear search algorithm. Write a recursive version of a linked-list-based linear search algorithm. Solution // Recursive C program to implement linear search on array #include <stdio.h> //A linear search algorithm to find and return index of the searched element int array_linear_search_recursion(int numbers[], int length, int element, int index) { if(index<length) { if(numbers[index] == element) return index; else return array_linear_search_recursion(numbers, length, element, index+1); } else { // element not present return -1; } } int main() { int array[] = {44, 5, 78, 90, 111, 3, 45, 133, 54, 2, 3}; // input array int element = 5; //element to be searched int length = sizeof(array)/sizeof(array[0]); int result = array_linear_search_recursion(array, length, element, 0); //calling function to apply linear search recursively if(result == -1) printf(\"Element is not present in array\"); else printf(\"Element is present at index %d\", result); return 0; } // Recursive C program to implement linear search on linked list #include <stdio.h> #include <stdlib.h> /* Link list node */ struct node { int key; struct node* next; }; /* push a new node on the front of the list. */ void push(struct node** head, int new_element) { struct node* new_node = (struct node*) malloc(sizeof(struct node)); /* put in the key */ new_node->key = new_element; /* link the old list off the new node */ new_node->next = (*head); /* move the head to point to the new node */ (*head) = new_node; } /* Counts no. of nodes in linked list */ int search(struct node* head, int target) { // Base case if (head == NULL) return 0; // If key is present in current node, return true if (head->key == target) return 1; // Recursion for remaining list return search(head->next, target); } /* Drier program to test count function*/ int main() { /* create an empty list */ struct node* head = NULL; int target = 77; /* Use push() to construct below list 55->77->87->3->9 */ push(&head, 9); push(&head, 3); push(&head, 87); push(&head, 77); push(&head, 55); if(search(head, target) == 1) printf(\"Element is present in Linked list\ \"); else printf(\"Element is not not present in Linked list\ \"); return 0; } .