Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Section I: Review Questions (2*10 = 20 points) Question 1-1. List at least five different algorithms you have learned. Question 12. Think about where we
Section I: Review Questions (2*10 = 20 points) Question 1-1. List at least five different algorithms you have learned. Question 12. Think about where we can use algorithms. Please write down at least two examples. Section II: Analysis(40 points) Question 2-1. (10 points) If you want to search data x from a large dataset of size n, which algorithm can be used to solve the problem faster? Please analyze the complexity of your solution. Question 2-2. (10 points) Use the substitution method to analyze the algorithm complexity (T(n)) of the recursive formula (write both the process and the result): T(n) = T(n-1) +1, TO) = 0. Question 23.(20 points) Write a recursion program to calculate the Fibonacci Numbers: FO=0, (1)=1, F(n)=F(n-1)+F(n-2). How many ways do you know for calculating the algorithm complexity of recursion program. Section III: Algorithms (40 points) Question 3-1. (10 points) Write the huffman coding result of array A=[2.5,1.6.10]. Question 3-2. (10 points) Describe what you know about the greedyalgorithm. For example, the basic idea, the process and the problems of greedyalgorithm. Question 3-3. (10 points) Describe the process of divide-and-conquer and then complete the following quick sort algorithm. void QS (float a[], int p, int :) { if (p
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