The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Analysis of Algorithms. - Super simple assignment Â
I have found solutions of the HW already so no work needs to be done.Â
All you have to do is rewrite the assignment in your own words. since this was off the web, i cannot submit it.
Â
The answers are there... ALL you have to do is rewrite in your own words! The solutions are in RED. just rewrite the solutions in your OWN WORDS.Â
Â
Â
Analysis of Algorithms1.What is the smallest number of divisions made by Euclid’s algorithm among allinputs 1 ≤m,n≤ 30?Solution: Smallest Number of division:1 when m= 1 ,n=12.What is the largest number of divisions made by Euclid’s algorithm among all inputs1 ≤m,n≤ 30?Solution: Largest Number of division : 7 ,when m=13 , n=213.#5, Exercises 1.1Design an algorithm to find all the common elements in two sorted lists of numbers. Forexample, for the lists 2, 5, 5, 5 and 2, 2, 3, 5, 5, 7, the output should be 2, 5, 5.What is themaximum number of comparisons your algorithm makes if the lengths of the two givenlists aremandn,respectively?Solution:Compare the starting element of both the listif they are equal push thatelement into the new list otherwise forward the pointer of list whose element issmaller repeat this process until both the list are fully processed.The maximum number of comparisons, which is made by this algorithm on some listswith no common elements such as the first m positive odd numbers and the first npositive even numbers, is equal to m+ n − 14.#12, Exercises 1.1