Recent questions tagged algorithms

0 votes
0 answers
1351
Please give an example i didn't get itThe depth of any DFS tree rooted at a vertex is at least as much as thedepth of any BFS tree rooted at the same vertex.
1 votes
2 answers
1352
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.
0 votes
2 answers
1353
0 votes
0 answers
1355
On which of the following recurrence relation Master Theorem cannot be applied?a) T(n)=2T(n/2)+nlognb) T(n)=T(n/2)+1c) T(n)=8T(n/2)+lognd) T(n)=7T(n/4)+n^2
0 votes
2 answers
1356
main() { int i,count; for (i=1; i<=n; i++) { for(i=1; i<=(n*n); i++) { for(i=1; i<=(n*n*n); i++) { count++; } } } }What will be the time complexity of the given program?
2 votes
1 answer
1357
In coremen it is given that$\log^kn$=$(\log n)^k$$\log\log n$ is not equal to $\log^2n$ i understood it with exampleplease correct me if I am wrong .
3 votes
1 answer
1358
Is following statement true/false? A DFS of a directed graph always produces the same number of tree edges, i.e., independent of the order in which vertices are considere...
1 votes
1 answer
1359
1 votes
1 answer
1360
1 votes
0 answers
1363
Solve the recurrence relation $T(n) = T(\sqrt{n}) + n$
0 votes
1 answer
1364
Solve the following recurrence relation :-N(h)=N(h−1)+N(h−2)+1
0 votes
0 answers
1365
If we have a n*n Bit-Array in which we have only 1's and 0's filled . Constraint is that in every row , 0 comes before 1 , so how to find the index of the row which has m...
1 votes
1 answer
1366
3 votes
2 answers
1367
What is the time complexity of following function fun()? Assume that log(x) returns log value in base 2.void fun() { int i, j; for (i=1; i<=n; i++) for (j=1; j<=log(i); j...
0 votes
0 answers
1370
I didn't understand Big-O notation: This is CORMEN exercise problem - 3.1-2Solution link: https://www.csee.umbc.edu/~nam1/TA/HWSols/hw1sol.pdf
0 votes
0 answers
1371
int main() { int i = -5; While(i<=5){ if(i>=0) break; else { i++; continue; } printf("GO"); }return 0;}
0 votes
1 answer
1372
Is np Completeness is there in syllabus ?,as it is not mentioned in syllabus.
1 votes
0 answers
1373
Iterated logarithmic function is defined asWhich of the following is/are TRUE ?(i) log∗n=O(log(logn))(ii) (log∗n)!=O(logn)(iii) (log∗n)^n=O((logn)!)i and ii onlyi a...
0 votes
1 answer
1374
0 votes
0 answers
1375
what is the worst case possible height of an avl tree ???https://www.geeksforgeeks.org/practice-questions-height-balancedavl-tree/how does 1.44*logn comes ????
2 votes
1 answer
1376
How to understand the nesting of for loops in these algorithms like which for loop comes under the other ?
0 votes
0 answers
1378