Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

code in C
provide a screenshot please
DONT USE STRING.H library
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions