Question: Problem 1 : Implement a Recursive Permutation Function ( 1 5 points ) Write a program which takes a string and recursively outputs each permutation
Problem : Implement a Recursive Permutation Function points
Write a program which takes a string and recursively outputs each permutation of the string.
For example, if the string is eat, then the output would be:
aet
ate
eat
eta
tae
tea
Note: The values do not have to be in alphabetical order.
Design, edit, run, test, and debug your program. Enter the completed C code here:
C code for the lab project: Problem : Implement a Recursive Conversion Function points
Write a program which defines a recursive function that takes a decimal integer as a parameter and outputs the binary equivalent as a string. The function should output the binary value of the integer one digit at a time. If the integer is even, capture a zero and call the function with the value divided by two; if the integer is odd, capture a one, and do the same. When the function returns to the caller, reverse the captured values to obtain the correct binary representation.
For example, if the input were decimal, the final result would be binary. Leading zeros should be suppressed.
Design, edit, run, test, and debug your program. Enter the completed C code here:
C code for the lab project:
Run the code, take a screenshot of the results, including the input and output files, and insert the screenshot here:
Screenshot of the results:
Problem : Implement a Recursive Merge Sort Function points
Write a program which implements a recursive merge sort function. An example can be found in the textbook or on the internet.
Write an is increasing function that ensures that each value in an array is nonstrictly increasing. This means that at a given index n the value at index n is greater than or equal to the value at n Return true if this property holds, false otherwise. Use this header:
bool is increassingint values, int size
Create an array of random integer values. Call the is increasing function which should return false.
Call the merge sort function and pass it the array of integers. Call the isjincreasing function again; it should return true.
For example: Assume an array is Calling isincreasing should return false because the value at index is less than the value at index After sorting the array is and calling the isincreasing function should return true because each value is not less than its predecessor.
Note: the term nonstrictly increasing means that two adjacent values may be equal; strictly increasing means that the rightmost value is greater than the leftmost value of the two. For random values, it is almost certain that duplicated values will exist.
Design, edit, run, test, and debug your program. Enter the completed C code here:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
