Show work please, thank you! I will give thumbs up

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899559
Joined: Mon Aug 02, 2021 8:13 am

Show work please, thank you! I will give thumbs up

Post by answerhappygod »

Show work please, thank you! I will give thumbs up
Show Work Please Thank You I Will Give Thumbs Up 1
Show Work Please Thank You I Will Give Thumbs Up 1 (41.52 KiB) Viewed 93 times
1. (10 points) Design an algorithm for computing [n] for any positive integer n. Besides assignment and comparison, your algorithm may only use the four basic arithmetical operations. 2. (10 points) Design an algorithm to find all the common elements in two sorted lists of numbers. For example, for the lists 2, 5, 5, 5 and 2, 2, 3, 5, 5, 7, the output should be 2, 5, 5.What is the maximum number of comparisons your algorithm makes if the lengths of the two given lists are m and n, respectively? 3. (10 points) Describe the standard algorithm for finding the binary representation of a positive decimal integer in pseudocode. 4. (10 points) Consider the following algorithm for finding the distance between the two closest elements in an array of numbers. Make as many improvements as you can in this algorithmic solution to the problem. If you need to, you may change the algorithm altogether, if not, improve the implementation given. ALGORITHM MinDistance(A[O. . n - 1]) //Input: Array Afo. .n - 1] of numbers //Output: Minimum distance between two of its elements dmin + 00 for i + O to n - 1do for j = 0 to n - 1 do if i =/= j and A[1] - A[][<dmin dmin + A - Al return dmin 5. (10 points) Design an algorithm for checking whether two given words are anagrams, i.e., whether one word can be obtained by permuting the letters of the other. For example, the words tea and eat are anagrams.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply