Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
4
votes
1
answer
1381
Clrs 16.2-6
Show how to solve the fractional knapsack problem in $O(n)$ time.
Show how to solve the fractional knapsack problem in $O(n)$ time.
Prince Sindhiya
1.1k
views
Prince Sindhiya
asked
Jul 22, 2018
Algorithms
algorithms
greedy-algorithm
+
–
0
votes
0
answers
1382
Self doubt
How to solve fractional knapsack problem using heap ?
How to solve fractional knapsack problem using heap ?
Prince Sindhiya
185
views
Prince Sindhiya
asked
Jul 22, 2018
Algorithms
algorithms
knapsack-problem
+
–
0
votes
2
answers
1383
GATE Algorithm question
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, 1 B: 5, 7 C: 3, 2 D: 1, 5
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
Phantom5
1.1k
views
Phantom5
asked
Jul 22, 2018
Algorithms
algorithms
+
–
0
votes
1
answer
1384
self doubt
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?
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?
Raj Kumar 7
684
views
Raj Kumar 7
asked
Jul 22, 2018
Programming in C
algorithms
+
–
2
votes
1
answer
1385
cormen 2nd edition excercise 23-2-5
Suppose that all edge weights in a graph are integers in the range from 1 to |V|. How fast can you make Prim's algorithm run? What if the edge weights are integers in the range from 1 to W for some constant W? Answer given :- The running time of Prims ... DECREASE-KEY speed up to O(lg lg V). Doubt 2 : why doubly linked list is used for range 1.... |W| ??
Suppose that all edge weights in a graph are integers in the range from 1 to |V|. How fast can you make Prim's algorithm run? What if the edge weights are integers in the...
Sandy Sharma
1.9k
views
Sandy Sharma
asked
Jul 21, 2018
Algorithms
algorithms
prims-algorithm
+
–
0
votes
0
answers
1386
Self doubt
How is IIIT Allahabad for mtech IT ? Which NIT’s are comparable to that ?
How is IIIT Allahabad for mtech IT ? Which NIT’s are comparable to that ?
Tushar Kumar 1
207
views
Tushar Kumar 1
asked
Jul 20, 2018
Written Exam
data-structures
algorithms
+
–
0
votes
0
answers
1387
self doubt
The number of different directed trees with 3 nodes are A) 3 B) 4 C) 5 D) 6 I think the answer is 5 but the answer is not.
The number of different directed trees with 3 nodes areA) 3B) 4C) 5D) 6I think the answer is 5 but the answer is not.
Raj Kumar 7
655
views
Raj Kumar 7
asked
Jul 17, 2018
Programming in C
algorithms
+
–
0
votes
2
answers
1388
Self doubt
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
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
Raj Kumar 7
1.6k
views
Raj Kumar 7
asked
Jul 17, 2018
Algorithms
algorithms
merging
sorting
+
–
0
votes
1
answer
1389
Masters theorem
Solve by using master's theorem
Solve by using master's theorem
bts
586
views
bts
asked
Jul 17, 2018
Algorithms
time-complexity
master-theorem
algorithms
asymptotic-notation
recurrence-relation
+
–
0
votes
3
answers
1390
Masters theorem
Solve using Master's Theorem $T(n)=T(n/2)+$ 2n
Solve using Master's Theorem$T(n)=T(n/2)+$ 2n
Vishnathan
865
views
Vishnathan
asked
Jul 16, 2018
Algorithms
master-theorem
algorithms
time-complexity
+
–
1
votes
0
answers
1391
Time Complexity
Consider the following C code: int f(int x){ if(x<1) return 1; else return f(x-1)+g(x); } int g(int x){ if(x<2) return 1; else return f(x-1)+g(x/2); } Of the following, which best describes the growth of f(x) as a function of x? a) logarithmic b) quadratic c) linear d) exponential please explain.
Consider the following C code:int f(int x){if(x<1) return 1;else return f(x-1)+g(x);}int g(int x){if(x<2) return 1;else return f(x-1)+g(x/2);}Of the following, which best...
nishant279
404
views
nishant279
asked
Jul 14, 2018
Algorithms
time-complexity
algorithms
+
–
1
votes
1
answer
1392
design and analysis of algorithms.
which of the following estimates are true? Explain with valid reasons. a) (2n)! is theta (n)! b) log((2n)!) is theta (log(n)!)
which of the following estimates are true? Explain with valid reasons.a) (2n)! is theta (n)!b) log((2n)!) is theta (log(n)!)
AIkiran01
2.0k
views
AIkiran01
asked
Jul 14, 2018
Algorithms
asymptotic-notation
algorithms
+
–
1
votes
0
answers
1393
Algorithms-Time Complexity
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^{10}))$ Please verify.
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^{...
Ayush Upadhyaya
740
views
Ayush Upadhyaya
asked
Jul 14, 2018
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
1
votes
1
answer
1394
TIme complexity
Q.14 What is the time complexity of the following recursive function? int Dosomething (int n) { if(n≤2) return 1; else return (Dosomething (floor(sqrt(n))) + n); (a) Ѳ(n 2 ) (c) Ѳ(log 2 n) (b) Ѳ(nlog 2 n) (d) Ѳ(log 2 log 2 n)
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 )...
pradeepchaudhary
1.4k
views
pradeepchaudhary
asked
Jul 14, 2018
Algorithms
time-complexity
algorithms
+
–
2
votes
2
answers
1395
Time Complexity Of the Algorithm
Q.6 The time complexity of an algorithm T(n), where n is the input size, is given by— T(n)= T(n-1) + 1/n, if n>1 = 1, otherwise. The order of the algorithm is— (a) log n (c) n^2 (b) n (d) n*n
Q.6 The time complexity of an algorithm T(n), where n is the input size, is given by— T(n)= T(n-1) + 1/n, if n>1 = 1, otherwise.The order of the algorithm is�...
pradeepchaudhary
9.2k
views
pradeepchaudhary
asked
Jul 14, 2018
Algorithms
algorithms
time-complexity
recurrence-relation
+
–
0
votes
4
answers
1396
UGC NET CSE | July 2018 | Part 2 | Question: 21
The solution of the recurrence relation $T(m) = T(3m/4)+1$ is $\Theta (\lg \: m)$ $\Theta (m)$ $\Theta (m\lg m)$ $\Theta (\lg\lg m)$
The solution of the recurrence relation $T(m) = T(3m/4)+1$ is$\Theta (\lg \: m)$$\Theta (m)$$\Theta (m\lg m)$$\Theta (\lg\lg m)$
Pooja Khatri
2.3k
views
Pooja Khatri
asked
Jul 13, 2018
Algorithms
ugcnetcse-july2018-paper2
algorithms
time-complexity
recurrence-relation
+
–
0
votes
1
answer
1397
UGC NET CSE | July 2018 | Part 2 | Question: 27
Match the following with respect to algorithm paradigms : ... $\text{(a)-(iv), (b)-(iii), (c)-(ii), (d)-(i)}$
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...
Pooja Khatri
2.4k
views
Pooja Khatri
asked
Jul 13, 2018
Algorithms
ugcnetcse-july2018-paper2
algorithms
+
–
0
votes
2
answers
1398
UGC NET CSE | July 2018 | Part 2 | Question: 30
Consider a Boolean function of 'n' variables. The order of an algorithm that determines whether the Boolean function produces a output 1 is Logarithmic Linear Quadratic Exponential
Consider a Boolean function of 'n' variables. The order of an algorithm that determines whether the Boolean function produces a output 1 isLogarithmicLinearQuadraticExpon...
Pooja Khatri
2.0k
views
Pooja Khatri
asked
Jul 13, 2018
Algorithms
ugcnetcse-july2018-paper2
algorithms
+
–
1
votes
1
answer
1399
Time Complexity for Log rquestions
void fun() { int i, j; for (i=1; i<=n; i++) for (j=1; j<=log(i); j++) printf("GeeksforGeeks"); } Soln--> thetha(nlogn) Anyone please explain me in detail how to solve log series problems and what are the prerequisites to solve log problems.As i get Stuck in log problems.Please Help! Thanks
void fun() { int i, j; for (i=1; i<=n; i++) for (j=1; j<=log(i); j++) printf("GeeksforGeeks"); }Soln thetha(nlogn) Anyone please explain me in detail how to solve log se...
Mayankprakash
1.5k
views
Mayankprakash
asked
Jul 13, 2018
Algorithms
time-complexity
algorithms
+
–
0
votes
0
answers
1400
self doubt
Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and then increasing downwards). Given a queue of size n in which we have to put all n elements ... will be the best algorithm and their time complexity? I think Merge sort is best algorithm, O(n log logk) Am I right or wrong?
Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and th...
Raj Kumar 7
593
views
Raj Kumar 7
asked
Jul 13, 2018
Algorithms
algorithms
+
–
0
votes
0
answers
1401
programming and data structure
que--Study the following program written in a block structured language. var p, q : integer; begin p:= p+q; q:= p−q; p:= p−q; end; (a) exchanges (p) and (q) (b) doubles (p) and stored in (q) (c) doubles (q) and stores in (p) (d) leaves (p) and (q) unchanged
que Study the following program written in a block structured language.var p, q : integer;begin p:= p+q; q:= p−q; p:= p−q;end;(a) exc...
air1ankit
609
views
air1ankit
asked
Jul 12, 2018
Programming in C
programming-in-c
data-structures
algorithms
+
–
0
votes
1
answer
1402
array
anyone please explain me how to find loc in lower triangular matrix , i am getting little bit confuse suppose matrix is 1 2 3 4 1 a11 a12 a13 a14 2 a21 a22 a23 a24 3 a31 a32 a33 a34 4 a41 a42 a43 a44 now i have to find location of a[4] b[3]:- given BA=1000 C=1 =1000+ [(4-1) * ((3)(4))/2 +(3-1)]*1 by this way i we get answer but something wrong please exolplain
anyone please explain me how to find loc in lower triangular matrix , i am getting little bit confuse suppose matrix is ...
air1ankit
707
views
air1ankit
asked
Jul 12, 2018
Programming in C
algorithms
data
data-structures
+
–
1
votes
3
answers
1403
Quicksort
Consider an array consisting of the following elements in unsorted order (placed randomly) but 60 as pivot element 60 80 15 95 7 12 35 90 55 Quicksort partition algorithm is applied by choosing first element as pivot element . How many total number of arrangement of array integers is possible preserving the effect of first pass of partition algorithm
Consider an array consisting of the following elements in unsorted order (placed randomly) but 60 as pivot element60 80 15 95 7 12 35 90 55Quicksort partition algorithm...
Tripti bhardwaj
4.1k
views
Tripti bhardwaj
asked
Jul 11, 2018
Algorithms
algorithms
quick-sort
numerical-answers
+
–
1
votes
1
answer
1404
CLRS 11.2-6
Suppose we have stored n keys in a hash table of size m, with collisions resolved by chaining, and that we know the length of each chain, including the length L of the longest chain. Describe a procedure that selects a key uniformly at random from among the keys in the hash table and returns it in expected time O(L * (1 + m/n)).
Suppose we have stored n keys in a hash table of size m, with collisions resolved by chaining, and that we know the length of each chain, including the length L of the lo...
mohitjarvissharma
797
views
mohitjarvissharma
asked
Jul 11, 2018
Algorithms
algorithms
hashing
chaining
+
–
1
votes
1
answer
1405
Asymptotic analysis
Arrange them in increasing order
Arrange them in increasing order
saumya mishra
923
views
saumya mishra
asked
Jul 11, 2018
Algorithms
algorithms
asymptotic-notation
+
–
0
votes
0
answers
1406
How to evaluate time complexity for below question ?
radha gogia
479
views
radha gogia
asked
Jul 11, 2018
Algorithms
algorithms
time-complexity
+
–
4
votes
0
answers
1407
time complexity
for(int i=0; i < n; i++) { for(int j=0; j < (2*i); j+=(i/2)) { cout<<"Hello Geeks"; } } is it o(nlogn)??
for(int i=0; i < n; i++) { for(int j=0; j < (2*i); j+=(i/2)) { cout<<"Hello Geeks"; } }is it o(nlogn)??
vijju532
1.5k
views
vijju532
asked
Jul 10, 2018
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
1
votes
1
answer
1408
Self doubt
When sorting technique is called stable?
When sorting technique is called stable?
imnitish
895
views
imnitish
asked
Jul 9, 2018
Algorithms
algorithms
sorting
+
–
4
votes
7
answers
1409
Searching
Q) Consider a sorted array of n numbers. What would be the time complexity of the best known algorithm to find a pair a and b such that |a-b| = k , k being a positive integer. a) O(logn) b) O(n) c)O(nlogn) d)O(n^2) Which of the option is Correct And Why?
Q) Consider a sorted array of n numbers. What would be the time complexity of the best known algorithm to find a pair a and b such that |a-b| = k , k being a positive int...
pradeepchaudhary
12.8k
views
pradeepchaudhary
asked
Jul 9, 2018
Algorithms
algorithms
sorting
time-complexity
binary-search
+
–
0
votes
3
answers
1410
Merge Sort
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)
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)...
pradeepchaudhary
1.5k
views
pradeepchaudhary
asked
Jul 8, 2018
Algorithms
merge-sort
algorithms
sorting
merging
+
–
Page:
« prev
1
...
42
43
44
45
46
47
48
49
50
51
52
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register