Recent questions and answers in Algorithms

0 votes
0 answers
2
In quick sort, n numbers the (n/10)th element is selected as pivot using n^2 sortimng time complexity what will be the time complexity of quick sort is.....a)O(nlogn)b)O(...
2 votes
1 answer
3
for (i = 1; i <= N; i++){ for (j= 1;j <= i^2;j=j+i){ //some code}} how is this O(n^2)? explain in detail and simple terms
56 votes
4 answers
4
Arrange the following functions in increasing asymptotic order:$n^{1/3}$$e^n$$n^{7/4}$$n \log^9n$$1.0000001^n$a, d, c, e, bd, a, c, e, ba, c, d, e, ba, c, d, b, e
3 votes
1 answer
6
1 votes
2 answers
9
int i,j,k,s=0; for(i=1; i<=n; i++) { for(j=1 ; j<=i; j=j*2) { for(k=n; k>1;k=k/2) { s++; } } }What will be the time complexity of the above code?
113 votes
9 answers
12
The number of elements that can be sorted in $\Theta(\log n)$ time using heap sort is$\Theta(1)$$\Theta(\sqrt{\log} n)$$\Theta(\frac{\log n}{\log \log n})$$\Theta(\log n)...
65 votes
12 answers
13
In a depth-first traversal of a graph $G$ with $n$ vertices, $k$ edges are marked as tree edges. The number of connected components in $G$ is$k$$k+1$$n-k-1$$n-k$
0 votes
0 answers
16
can anyone have the algorithm notes from go classes (PDF or material)
0 votes
0 answers
22
Calculate the minimum and maximum number of element comparisons involved in 2 way merge sort assuming n is power of 2.
21 votes
7 answers
25
1 votes
1 answer
26
Consider the following graph.How many nodes (apart from $s$) does the Depth First Search algorithm discover before discovering $t$ when starting from $s.$
21 votes
4 answers
31
Consider functions $\textsf{Function_1}$ and $\textsf{Function_2}$ expressed in pseudocode as follows:Function_1 | Function_2 while n 1 do | for i = 1 to 100 * n do for ...
0 votes
1 answer
33
$\text{Please explain True or False and Why ?}$$\text{1. f(n) = O(f(n/2))}$$\text{2. f(n) = O($f(n)^{2}$) }$
To see more, click for all the questions in this category.