Question: Algorithms Analysis and Design Assignment 1 Notes: When you send the solution of the Assignment mention the HW characterizes of the used device Insert the

Algorithms Analysis and Design
Assignment 1
Notes:
When you send the solution of the Assignment mention the HW characterizes of the used device
Insert the applied code before the Tables result.
Use the function that calculate time in the programming language used
Q1: Use Compiler (ex: C++) to create 2(n**n) matrices [A]**[B]=[C]. Generate A and B randomly as follows:
\table[[[A]**[B],\table[[Execution],[Time]]],[[100**100]**[100**100],],[[500**500]**[500**500],],[[1000**1000]**[1000**1000],],[[2500**2500]**[2500**2500],],[[5000**5000]**[5000**5000],],[[1000****10000]**[10000**10000],],[[20000**20000]**[20000**20000],]]
Q2: A) Use Compiler (in: C++) to create array A=[....n], Generate A randomly as follows, then apply insertion and selection sort for the same generated
Q2: A) Use Compiler (in: C++) to create array A=[....n], Generate A randomly as follows, then apply insertion and selection sort for the same generated array:
\table[[A=[1dotsdotsn],\table[[Insertion sort],[time]],\table[[Selection sort],[time]]],[100,,],[500,,],[1000,,],[2500,,],[5000,,],[10000,,],[25000,,],[50000,,],[100000,,],[,,]]
B) Apply insertion sort to sort the string "algorithm" in alphabetical order
Show each iteration of insertion sort on the string. Find the number of comparisons
Q3: Prove or disprove
5n2+40n+100=O(n2).
n31000=O(n2).
f(n)=i=1ni2. is f(n)=On3?
nk=O2n
nlogn

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!