All Questions

510 questions and answers

1056 views

Write a short note on Asymptotic Notations.

Asymptotic Notations are languages that allow us to analyze an algorithm's running time by identifying its behavior as the input size for the algorithm increases. It is used to describe the asymptotic behaviour of complexities of algorithms.

Demo Teacher
added 2 years ago
1748 views

Why Recursion tree method is best than the Substitution method for solving a recurrence relation?  Find the asymptotic upper bound of the following recurrence relation with the help of recursion tree method.

T(n)=T(n/4)+T(n/2)+Θ(n2)

Recursion tree method is best than the Substitution method for solving a recurrence relation because in recursion tree method, we draw a recurrence tree and calculate the time taken by every level of tree.

Demo Teacher
added 2 years ago
999 views

What do you mean by dynamic programming? Write the algorithm of chain matrix multiplication. 

It is a problem solving technique like divide and conquer where problems are divided into subproblems. Dynamic programming is used when the subproblems are not independent.

Demo Teacher
added 2 years ago
1483 views

Find the recurrence relation of binary search and derive the time complexity of binary search.

Binary search is a technique to find a particular element in a sorted list of elements. Suppose L is the sorted list and d is the element to be searched, lb is the lower bound of the list and ub is the upper bound of the list.

Demo Teacher
added 2 years ago
952 views

Write a C program to multiplication of two matrix.

#include<stdio.h> #include<conio.h> main() { int a[10][10],b[10][10],c[10][10],m,n,p,q,i,j,k;

Demo Teacher
added 2 years ago
1069 views

Write a C program to find factorial(using recursion) of any no.

#include<stdio.h> #include<conio.h> int fact(int); main() { int n,result;

Demo Teacher
added 2 years ago
959 views

Write a C program to print pattern below:

*

* *

* * *

* * * *

#include<stdio.h> #include<conio.h> main() { int n,i,j;

Demo Teacher
added 2 years ago
1056 views

Write a C program to convert decimal no. to binary.

#include<stdio.h> #include<conio.h> main() { int bin[50],i=0,n,j;

Demo Teacher
added 2 years ago