Answer to Question #243445 in Algorithms for thara

Question #243445


Define what an algorithm is and outline the characteristics of a good algorithm. Write the algorithms to display the Fibonacci series and the factorial value for a given number using Pseudo code. Determine the steps involved in the process of writing and executing a program.

Take a sample number and dry run the above two algorithms. Show the outputs at the end of each iteration and the final output. Examine what Big-O notation is and explain its role in evaluating efficiencies of algorithms. Write the Python program code for the above two algorithms and critically evaluate their efficiencies using Big-O notation.


1
Expert's answer
2021-09-28T07:25:20-0400

An algorithm is a procedure of solving a problem which is based on conducting a sequence of specified actions. In simple word, an algorithm is a set of instructions which solve a particular set of problems. It can be viewed as an elaborate algorithm.

Algorithm for Fibonacci series:

start 
Fib n=1
Fib(n-1)=0
For (i=0;i<n;i++)
  Fib(n+1)= Fib(n-1)+Fib(n)
  print(Fib(n+1))
end

There is one for loop, so the complexity of the algorithm is O(n).


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS