Recent questions tagged algorithms

4 votes
1 answer
1381
Show how to solve the fractional knapsack problem in $O(n)$ time.
0 votes
0 answers
1382
How to solve fractional knapsack problem using heap ?
0 votes
2 answers
1383
what will be the result when the following postfix expression with single digit operand is evaluated using stack:8 2 3 ^ / 2 3 * + 5 1 * - ? A: 6, 1B: 5, 7C: 3, 2D: 1, 5
0 votes
1 answer
1384
Given a pointer to a node to be deleted what is the time complexity to delete a node in the circular linked list :i think answer is O(1).Am i right?
0 votes
0 answers
1386
How is IIIT Allahabad for mtech IT ? Which NIT’s are comparable to that ?
0 votes
0 answers
1387
The number of different directed trees with 3 nodes areA) 3B) 4C) 5D) 6I think the answer is 5 but the answer is not.
0 votes
2 answers
1388
The total number of comparions required to merge 4 sorted files containing 15, 3, 9 and 8 records into a single sorted file is A.66 B.39 C.15 D.33
0 votes
1 answer
1389
0 votes
3 answers
1390
Solve using Master's Theorem$T(n)=T(n/2)+$ 2n
1 votes
1 answer
1392
which of the following estimates are true? Explain with valid reasons.a) (2n)! is theta (n)!b) log((2n)!) is theta (log(n)!)
1 votes
0 answers
1393
What is the time complexity of the below code?for($k=n^{10};k \geq 5;k=k^{\frac{1}{7}},k=k^2$){ $k=k^5;$ $k=k-10$}My answer comes to be $O(log_{\frac{7}{10}}log_5(n^{...
1 votes
1 answer
1394
Q.14 What is the time complexity of the following recursive function?int Dosomething (int n) {if(n≤2)return 1;elsereturn (Dosomething (floor(sqrt(n))) + n);(a) Ѳ(n 2 )...
2 votes
2 answers
1395
0 votes
4 answers
1396
0 votes
1 answer
1397
Match the following with respect to algorithm paradigms :$\begin{array}{clcl} & \textbf{List-I} & {} & \textbf{List-II} \\ \text{(a)} & \text{The 8-Queen's problem} & \t...
0 votes
2 answers
1398
Consider a Boolean function of 'n' variables. The order of an algorithm that determines whether the Boolean function produces a output 1 isLogarithmicLinearQuadraticExpon...
1 votes
1 answer
1405
4 votes
0 answers
1407
for(int i=0; i < n; i++) { for(int j=0; j < (2*i); j+=(i/2)) { cout<<"Hello Geeks"; } }is it o(nlogn)??
1 votes
1 answer
1408
When sorting technique is called stable?
4 votes
7 answers
1409
0 votes
3 answers
1410
A list of n string, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is(A) (B) (C) (D)...