About Me

My photo
Vijayapur, Karnataka, India
I am interested in Teaching.

Tuesday 6 February 2018

Assignment-1: Design and Analysis of Algorithms (Even Sem. 2017-18)

Assignment-I
1. What is an algorithm? Discuss its characteristics.

2. Discuss three ways to compute greatest common divisor of m and n.

3. Discuss in brief about "General Analysis Framework"

4. What is basic operation? Find the basics operations in following code.

[a]
i=1,prod=1;
while(i<=n)
{
prod=prod*i;
i=i+1;
}
printf("\n Factorial is %f",prod);

[b]
for(i=0;i<n;i++)
{
   for(j=0;j<n-i-1;j++)
  {
        if (a[j]>a[j+1])
       {
       temp=a[j];
       a[j]=a[j+1];
       a[j+1]=temp;
       }
    }
}

5. What is the unit used by computer professionals to measure the running time of designed algorithm?








No comments:

GCD of two numbers and its application...

The greatest common divisor (gcd) of two numbers is the largest positive integer that divides both numbers without leaving a remainder. The ...