search
Log In

Recent questions tagged algorithms

0 votes
1 answer
1
An algorithm is made up pf two modules $M1$ and $M2.$ If order of $M1$ is $f(n)$ and $M2$ is $g(n)$ then the order of algorithm is $max(f(n),g(n))$ $min(f(n),g(n))$ $f(n) + g(n)$ $f(n) \times g(n)$
asked Apr 1 in Algorithms Lakshman Patel RJIT 241 views
0 votes
1 answer
2
0 votes
2 answers
3
0 votes
3 answers
4
0 votes
2 answers
5
Consider the following C code segment: int Ls Prime(n) { int i,n; for(i=2;i<=sqrt(n);i++) if(n%i ==0) { printf( NOT Prime.\n ); return 0; } return 1; } Let $T(n)$ denote the number of times the for loop is executed by the program on input $n.$ ... $T(n) = O(\sqrt{n})$ and $T(n) = \Omega (1)$ $T(n) = O(n)$ and $T(n) = \Omega (\sqrt{n})$ None of these
asked Apr 1 in Algorithms Lakshman Patel RJIT 137 views
0 votes
1 answer
6
0 votes
3 answers
7
An algorithm is made up of two modules $M1$ and $M2.$ If order of $M1$ is $f(n)$ and $M2$ is $g(n)$ then he order of algorithm is $max(f(n),g(n))$ $min(f(n),g(n))$ $f(n) + g(n)$ $f(n) \times g(n)$
asked Apr 1 in Algorithms Lakshman Patel RJIT 100 views
1 vote
1 answer
8
1 vote
2 answers
9
The average search time of hashing, with linear probing will be less if the load factor : is far less than $1$ equals $1$ is far greater than $1$ none of the options
asked Mar 31 in Algorithms Lakshman Patel RJIT 135 views
1 vote
2 answers
11
Given two sorted list of size '$m$' and '$n$' respectively. The number of comparisons needed in the worst case by the merge sort algorithm will be : $m^{*}n$ minimum of $m, n$ maximum of $m, n$ $m+n-1$
asked Mar 31 in Algorithms Lakshman Patel RJIT 166 views
3 votes
12 answers
12
Which of the following sorting algorithms does not have a worst case running time of $O(n​^2​)$? Insertion sort. Merge sort. Quick sort. Bubble sort.
asked Mar 31 in Algorithms Lakshman Patel RJIT 604 views
0 votes
2 answers
13
A hash function $f$ defined as $f(\text{key})=\text{key mod }7$, with linear probing, insert the keys $37,38,72,48,98,11,56$ into a table indexed from $11$ will be stored in the location $3$ $4$ $5$ $6$
asked Mar 31 in Algorithms Lakshman Patel RJIT 118 views
1 vote
1 answer
14
A hash table has space for $100$ records. Then the probability of collision before the table is $10\%$ full, is $0.45$ $0.5$ $0.3$ $0.34$ (approximately)
asked Mar 31 in Algorithms Lakshman Patel RJIT 148 views
0 votes
3 answers
15
Time complexity of an algorithm $T(n)$, where $n$ is the input size is given by $\begin{array}{ll}T(n) & =T(n-1)+1/n, \text{ if }n>1\\ & =1, \text{ otherwise} \end{array}$ The order of this algorithm is $\log n$ $n$ $n^2$ $n^n$
asked Mar 31 in Algorithms Lakshman Patel RJIT 285 views
0 votes
1 answer
16
0 votes
3 answers
17
1 vote
2 answers
18
1 vote
2 answers
19
Complexity of Kruskal's algorithm for finding minimum spanning tree of an undirected graph containing $n$ vertices and $m$ edges if the edges are sorted is: $O(mn)$ $O(m)$ $O(m+n)$ $O(n)$
asked Mar 31 in Algorithms Lakshman Patel RJIT 205 views
1 vote
1 answer
21
0 votes
3 answers
22
The running time of Quick sort algorithm depends heavily on the selection of: No. of inputs Arrangement of elements in an array Size of elements Pivot Element
asked Mar 31 in Algorithms Lakshman Patel RJIT 333 views
0 votes
3 answers
23
0 votes
2 answers
25
The concept of order Big O is important because It can be used to decide the best algorithm that solves a given problem It is the lower bound of the growth rate of algorithm It determines the maximum size of a problem that can be solved in a given amount of time Both (A) and (B)
asked Mar 31 in Algorithms Lakshman Patel RJIT 157 views
0 votes
2 answers
26
What is the running time of the following function (specified as a function of the input value)? void Function(int n){ int i=1; int s=1; while(s<=n){ i++; s=s+i; } } $O(n)$ $O(n^2)$ $O(1)$ $O(\sqrt n)$
asked Mar 30 in Algorithms Lakshman Patel RJIT 296 views
0 votes
2 answers
27
$0/1$-Knapsack is a well known problem where, it is desired to get the maximum total profit by placing $n$ items (each item is having some weight and associated profit) into a knapsack of capacity $W$. The table given below shows the weights and associated profits for $5$ items, where one unit of ... $19$ $18$ $17$ $20$
asked Mar 30 in Algorithms Lakshman Patel RJIT 171 views
0 votes
2 answers
28
The worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are $\Theta(n \log n),\Theta(n \log n) \text{ and } \Theta(n^2)$ $\Theta(n^2),\Theta(n^2)\text{ and } \Theta(n \log n)$ $\Theta(n^2), \Theta(n \log n)\text{ and } \Theta(n \log n)$ $\Theta(n^2),\Theta(n\log n) \text{ and } \Theta(n^2)$
asked Mar 30 in Algorithms Lakshman Patel RJIT 149 views
0 votes
2 answers
29
Which of the following standard algorithms is not Dynamic Programming based? Bellman-Ford Algorithm for single source shortest path Floyd Warshall Algorithm for all pairs shortest paths $0-1$ Knapsack problem Prim’s Minimum Spanning Tree
asked Mar 30 in Algorithms Lakshman Patel RJIT 212 views
...