Recent questions tagged algorithms

248
views
0 answers
0 votes
Consider the following directed graph and assume the number of paths to reach to itself i.e. N(A) = 1.Number of paths from A to K are __
410
views
0 answers
0 votes
Consider the following statements, which of the statement(s) is/are FALSE?The running time of dynamic programming algorithm is always θ (p) where p is number of ... can be reduced to a known NP hard problem, then X must be NP-hard
531
views
0 answers
0 votes
537
views
0 answers
0 votes
Let $f(n)$ be a positive increasing function. Consider the below two statements:S1: if an algorithm is $\Theta(f(n))$ in the average case, then it is $\Omega(f(n))$ ... $g(n)$ belongs to the set $\Theta(f(n))$, right?
497
views
4 answers
0 votes
A recursion program without a terminating condition will provide infinite output. True/False?
1.2k
views
2 answers
5 votes
Consider the function func shown below: int func(int num) { int count = 0; while (num) { count++; num>>= 1; } return (count); }The value returned by func(-435) is:69Will loop foreverDepends on computer architecture
644
views
0 answers
1 votes
Can anyone solve this recurrence relation T(n) = 3T(n-1) + O(n^2)Its ans is O(3^n n^2)
372
views
0 answers
2 votes
529
views
1 answers
3 votes
495
views
1 answers
2 votes
What is the correct time complexity in $\theta()$ ?
710
views
1 answers
1 votes
What is the worst case time complexity of an efficient algorithm (in order of n) to get the last index for an actually filled element, in an array, given the condition that we may ... be filled in a sorted order]O(n)O(1)O(log(n))O($n^2$)
821
views
2 answers
1 votes
What is the minimum number of nodes required in a DAG (Directed Acyclic Graph) for the following block?\[\begin{aligned}U=Z & =V+W \\X=Y & =U+1 \\A & =X+Y\end{aligned}\]