Recent questions tagged tbb-algorithms-2

0 votes
1 answer
1
The cost of optimal binary search tree for the identifier set $(a1, a2, a3) =$ (do, if, while) with $p(1) = 0.3, \ p(2) = 0.2, $ $p(3) = 0.15, q (0) = 0.05, q(1) = 0.15...
2 votes
2 answers
3
Assume Dijkstra's Algorithm is used to find the shortest paths from node G in the above graph. The total number of edges which are not included in any of the shortest pat...
1 votes
2 answers
4
The total number of LCS (Longest Common Subsequences) of $P = abcd123$ and $Q= badc321$ that can be formed are ______.
0 votes
1 answer
5
Consider the following instance of the knapsack problem :$\begin{array}{|c|c|c|c|c|c|} \hline \text{Item} & a & b & c & d & e \\ \hline \text{Benefit} & 15 & 12 & 9 & 16 ...
0 votes
1 answer
6
Let $T$ be a rooted ternary tree where each internal node of $T$ has a maximum of $3$ children. If root is at depth $0$, then maximum total number of vertices $T$ can hav...
0 votes
3 answers
7
1 votes
1 answer
10
The number of comparisons required to find the maximum and minimum element in an array $A[n]$ using Divide and Conquer method is:$(3n/2)+ 2$$(3n/2) - 2$$3n$$3n/2$
2 votes
1 answer
11
Consider the following Graph G: The number of minimum cost spanning trees using Kruskal's Algorithm is _________ .
0 votes
1 answer
12
A hash table of length $7$ uses open addressing with hash function $h(k) = k \text{mod }7$ and linear probing to resolve collisions.After inserting 6 values in an empty h...
1 votes
1 answer
14
Which of the following are TRUE?$n! = \theta ((n + 1)!)$$\log4 n = \theta ( \log2 n )$$\sqrt{\log n} = O(\log \log n)$(i) & (iii) only(i) & (ii) only(ii) only(i),(ii) ...
0 votes
1 answer
15
0 votes
2 answers
16
The length of the longest common subsequence of $L = ( 1,0,0,1,0,1,0,1 )$ and $K =( 0,1,0,1,1,0,1,1,0 )$ is __________.
2 votes
2 answers
17
Match the following:$\begin{array}{|l|l|l|l|} \hline (1) & \text{Multistage graph} & (P) & \text{Divide and conquer}\\ \hline (2) & \text{Convex hull } & (Q) & \text{Dept...
1 votes
2 answers
18
Which one of the following is a topological sort for the above graph?$1, 6, 2, 5, 3, 4$$4, 5, 6, 3, 2, 1$$2, 4, 5, 6, 3, 1$$6, 4, 5, 2, 1, 3$
0 votes
1 answer
19
The time complexity of the function mentioned below is:void f(int k[], int n) { int i; printf("%d",n); for(i=0; i<n; i++) { printf("%d",k[i]); } printf("n"); }$O(n^2)$$O(...
1 votes
2 answers
21
In Strassen's Matrix Multiplication, what is the number of additions and multiplications done to get a better complexity than the normal matrix multiplication?$7$ and $16...
0 votes
1 answer
22
Linked Lists are not suitable for :Binary SearchPolynomial ManipulationInsertionRadix Sort
0 votes
2 answers
25
$O(n^k)$ is complexity of the best method that finds longest Palindrome Substring in a word. For example, in the word "Atatb", the longest palindrome string is "tat". The...
0 votes
1 answer
26
A problem called Boolean Parenthesis Matching (match all parenthesis in an expression) can be solved by:Greedy ApproachRecursionDynamic ApproachBoth [B] and [C]
0 votes
1 answer
28
Which of the following algorithms CANNOT be designed without recursion?Tower of HanoiFibonacci SeriesTree TraversalNone of the above
0 votes
3 answers
29
Find the time complexity of the functionfunction( int n) { int i=1; while( i<n) { int j=n; while( j>0) j=j/2; i=2*i; } }$O(\log n)$$O(n^2 \log n )$$O(\log 2 n)$$O( \log n...
1 votes
2 answers
30
Which of the following theorems can solve all Recurrence Relations?Mater TehoremAkra-Bazzi TheoremBoth [A] and [B]Akra-Bazzi can be applied to some cases but not for all....
To see more, click for the full list of questions or popular tags.