Answer to Question #239839 in Algorithms for Dini

Question #239839

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-21T06:47:37-0400

Algorithm is a set of instruction for any task to resolve or we can say we have to follow the particular set of steps to solve the problems. The facts are called as the data and the useful information is called as the knowledge for any particular issue.

Pseudo code for Fibonacci series:

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

Pseudo code for Factorial:

start
scan value n
for (i=0;i<n;i++)
  fact=n*n(n-1)
print fact
end

As here we are using only one for loop in both the loop, so here the complexity of the algorithm be 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