Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3: (20 marks) Find the complexity of the following blocks of code or algorithm's description. [Note: your answer must show the steps that lead

Question 3: (20 marks) Find the complexity of the following blocks of code or algorithm's description. [Note: your answer must show the steps that lead to your final answer] (4 marks each) 1) count = 1 for i = 1 to 100 do count += i for k = 1 to 100 do count *= k while j < n do count +=j j *= 2; end while 2) def Process (int n): if (n == 0) do one arithmetic operation else for (i = 1; i < n; i++) Process(i) 3) The algorithm solves the problem of size n by dividing it into 8 subproblems of size n/2, recursively solving each sub-problem, and then combining the solutions in O(n3 ) time 4) The algorithm solves the problem by breaking it into 4 sub-problems of 1/2 the scale, recursively solving each sub-maze, and then combining the solutions in linear time 5) The algorithm solves the problem of size n by recursively solving two sub-problems of size n - 1, and then combining the solutions in constant time. Note: You should submit all your answers in one big word file. Criterion Unsatisfactory Average Good Algorithm Design Incomplete. ? Complete but looks like an essay not a professional algorithm. ? 100% Complete nd in a professional format ? Explanation of the pseudo-code is provided ? looks efficient in terms of running time and of memory usage ? Comments on the efficiency Implementation Using Python ? Incomplete ? Poor use of white space (indentation, blank lines, ambiguous naming of variables) ? Organized work, with correct use of space, variables, and naming. Completed 100% ? Comments on the code Screen shot of the run and comments. Organized indentation with good use of variables ? Tested with any simple input case study. ? Documented briefly in terms of (input, output, functions purposes) Complexity analysis ? No answer ? Incomplete answr or partially correct. ? Completed 100%. Explanation is provided. Report ? Irrelevant text or no answer. ? some effort but the report is not organized ? logical representation of the arguments in terms of problem's categories, solving technique, complexity, memory consumption and ending with a correct conclusion.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions