Question
Hello chegg expert please I need the correct and complete answers of those questions they are very important for me and in the same time
Hello chegg expert please I need the correct and complete answers of those questions they are very important for me and in the same time it's urgent very very urgent please please help me l need your help .
Question 2-1. Recursion plays an important role in algorithm design. You are required to give your understanding about recursion, such as the definition and where it can be used.
Question 2-2. In our real life, many different methods can be used to solve a given problem (e.g. sorting). Do you know how to make a better choice? Please write down your idea and reasons.
Question 2-3. Compare the differences between selection sort and quick sort, and give your understanding about the divide-and-conquer algorithm.
Question 3-1. Suppose there are n steps in a stair. Each time you can only take one or two steps. The relationship between n and the number of ways to go upstairs is shown in the following table Calculate how many ways to go upstairs by using by writing: (1) a recursion program: int JUMP_R(int n); (2) a dynamic programming program: int JUMP_DP (int n ). Question 3-2. Implement the following program to solve the Hanoi tower problem by moving the plates from pillar a to pillar b with the help of pillar c. Draw the moving process for n=3. yoid Hanoi(int n, int a, int b, int c ) \{ if (n==1) else\{ Hanoi(n-1, a, c, b); Move(n,a,b); \} 1-1. Which of the following cannot be solved by using the greedy algorithm? ( ) A. Exchange problem B. 4-Queen problem C. Huffman coding D. Overload problem 1-2. Which of the following is the best in average? ( ) A. Bubble sort B. Selection sort C. Insertion sort D. Quick sort 1-3. Which is the time complexity of binary search under the best case? ( ) A. Q(1) B. O(n) C. O(logn) D. O( nlogn) 1-4. The complexity of the formula T(n)=3nlogn+6n+1 is () A. Q(3nlog) B. O(6n) C. O( nlogn) D. O(1) 1-5. Matrix multiplication can be implemented by using? ( ) A. Dynamic Programming B. Greedy C. Backtracking D. Bound and BoundaryStep 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