Program 1. Given two non negative integers, m and n, your recursive function should compute the highest common factor (HCF), also known as greatest common divisor (GCD) using the following algorithm:
If m or n is zero then, respectively, n or m is the GCD.
If m is equal to n then m is the GCD.
IF m > n then the GCD is the GCD of (m-n) and n.
If n > m then the GCD is the GCD of (n-m) and n.
Program 2. Given that array, say A, of length n contains non-negative integers and given another non-negative integer, say k, do a linear search of A for k using recursion: If n is equal to 1 then if A is equal to k then the value returned is true otherwise he value returned is false. If n > 1 then if A[n-1] == k then the value returned is true else search the array through its n-1 cells.
Program 3. Modify the program that produces permutations of n things taken n at a time to produce permutations of n things taken r at a time. I have given you the program that needs to be modified
It is not our intention to break the school's academic policy. Projects posted are only used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly fill out the form.
Please provide a valid email address and we'll get back to you in less than 24 hours.
We will be sending an invoice through PayPal upon confirmation.
We are a non profit organization however we need an amount to keep this organization running,
and to be able to complete our research and development.