Question: code in C provide a screenshot please DONT USE STRING.H library Question 3 [25 points) Write a recursive C function named CountABC that finds the
Question 3 [25 points) Write a recursive C function named CountABC that finds the number of occurrences (b) of the string ABC in an array of characters. The function takes 3 parameters: an array of characters, the start index (integer) and the end index (integer). It divides the array into two equal parts (left half and right half) and calls itself to recursively count ABC in each half. Using the number of occurrences in the left half and the number of occurrences in the right half as well as the possible occurrence of ABC across the two halves, the function computes the number of occurrences in the entire array. The base case is an array with size 3 or less. For simplicity, assume that the array size is three times a power of 2 (6, 12, 24, ...). For example, if the array size is 12, 3 the initial call to CountABC will pass the array name, a start index of 0 and an end index of 11. CountABC will then divide this into two halves: one with a start index of O and an end index of 5 (left half) and another with a start index of 6 and an end index of 12 (right half). It will then call itself recursively on each of these two halves, and so on
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
