Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[ 2 0 % ] Design a recursive algorithm to solve each of the following problems and analyse the worst - case time complexity of
Design a recursive algorithm to solve each of the following problems and
analyse the worstcase time complexity of your algorithm. Nonrecursive
algorithms will score marks.
a Given an array of numbers find the average of all numbers in the
array. For example, if the given array is the output
of the algorithm should be
b Given an array of integers reverse the entries in the array. You are
only allowed to use constant amount of extra storage eg if you use
another array of entries in your algorithm, you score marks For
example, if the given array is the output of the algorithm
should be
b Given an integer output all binary strings of length such that
the sum of the first bits the sum of the second bits. For example, if
then the algorithm should output:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started