Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged geeksforgeeks-test-series
0
votes
1
answer
1
Geeks Quiz
rsansiya111
377
views
rsansiya111
asked
Dec 18, 2021
DS
data-structures
linked-list
geeksforgeeks-test-series
+
–
4
votes
3
answers
2
GEEKS FOR GEEKS GATE 2017 MOCK
If Kruskal’s algorithm is used for finding a minimum spanning tree of a weighted graph G with n vertices and m edges and edge weights are already given in a sorted list, then, What will be the time complexity to compute the minimum cost spanning tree given that union and find operations take amortized O(1) ? A O(m logn) B O(n) C O(m) D O(n logm)
If Kruskal’s algorithm is used for finding a minimum spanning tree of a weighted graph G with n vertices and m edges and edge weights are already given in a sorted list...
Hirak
3.6k
views
Hirak
asked
Jun 9, 2019
Algorithms
graph-algorithm
minimum-spanning-tree
time-complexity
geeksforgeeks-test-series
+
–
0
votes
1
answer
3
analysis of algorithm
pradeepchaudhary
829
views
pradeepchaudhary
asked
May 9, 2019
Algorithms
recurrence-relation
time-complexity
geeksforgeeks-test-series
+
–
1
votes
1
answer
4
Which of the following condition is sufficient to detect cycle in a directed graph?
Which of the following condition is sufficient to detect cycle in a directed graph? (A) There is an edge from currently being visited node to an already visited node. (B) There is an edge from currently being visited node to ... seen twice in DFS. (D) None of the bove here option B is right, but why not option A?
Which of the following condition is sufficient to detect cycle in a directed graph?(A) There is an edge from currently being visited node to an already visited node.(B) T...
Gangani_Son
13.3k
views
Gangani_Son
asked
Dec 12, 2018
Algorithms
graph-theory
depth-first-search
geeksforgeeks-test-series
graph-algorithm
+
–
0
votes
2
answers
5
GeeksForGeeks
Find time complexity of below Program? A(n){ if(n<=1) return; else return $A(\sqrt{n})$ ; }
Find time complexity of below Program?A(n){if(n<=1) return;elsereturn $A(\sqrt{n})$ ;}
Rustam Ali
855
views
Rustam Ali
asked
Sep 3, 2018
Algorithms
time-complexity
recursion
geeksforgeeks-test-series
+
–
0
votes
1
answer
6
Geeks - Doubt
What is time complexity of fun()? int fun(int n) { int count = 0; for (int i = n; i > 0; i /= 2) for (int j = 0; j < i; j++) count += 1; return count; } (A) O(n^2) (B) O(nLogn) (C) O(n) (D) O(nLognLogn)
What is time complexity of fun()?int fun(int n){ int count = 0; for (int i = n; i 0; i /= 2) for (int j = 0; j < i; j++) count += 1; return count;}(A) O(n^...
Sumit Singh Chauhan
3.4k
views
Sumit Singh Chauhan
asked
Aug 18, 2018
Algorithms
algorithms
time-complexity
geeksforgeeks-test-series
+
–
0
votes
1
answer
7
GeeksForGeeks Quiz
Q) Consider a situation where swap operation is very costly. Which of the following sorting algorithms should be preferred so that the number of swap operations are minimized in general? (A) Heap Sort (B) Selection Sort (C) Insertion Sort (D) Merge Sort The Answer ... is (B). But My question is Why not (D) Since There is not a Single Swap operation is performed in Merge Sort.
Q) Consider a situation where swap operation is very costly.Which of the following sorting algorithms should be preferred so that the number of swap operations are minimi...
pradeepchaudhary
8.1k
views
pradeepchaudhary
asked
Jul 8, 2018
Algorithms
algorithms
sorting
geeksforgeeks-test-series
+
–
2
votes
1
answer
8
GeeksForGeeks
Which data structure is most efficient to find the top 10 largest items out of 1 million items stored in file? A Min heap B Max heap C BST D Sorted array
Which data structure is most efficient to find the top 10 largest items out of 1 million items stored in file?AMin heapBMax heapCBSTDSorted array
Rishav Kumar Singh
2.8k
views
Rishav Kumar Singh
asked
Jun 15, 2018
DS
data-structures
binary-heap
geeksforgeeks-test-series
+
–
0
votes
1
answer
9
Geeksforgeeks quiz
Let G be the CFG, l be the number of left most derivations, r be the number of right most derivations and P be the number of parse trees. Assume l , r and P are computed for a particular string. For a given CFG ‘G’ and given string ‘w’, what is the relation between l , P , r ? A l ≤ P ≥ r B l = P = r C l ≥ P ≤ r D none of these
Let G be the CFG, l be the number of left most derivations, r be the number of right most derivations and P be the number of parse trees. Assume l , r and P are computed ...
ARUN KUMAR 3
1.4k
views
ARUN KUMAR 3
asked
Sep 6, 2017
Compiler Design
compiler-design
context-free-grammar
parsing
geeksforgeeks-test-series
+
–
1
votes
2
answers
10
Gate Sample Question
int f(int n) { static int i = 1; if (n ≥ 5) return n; n = n + i; i++; return f(n); } The value returned by f(1) is: (a) 5 (b) 6 (c) 7 (d) 8 need solution with explaination
int f(int n) { static int i = 1; if (n ≥ 5) return n; n = n + i; i++; return f(n); }The value returned by f(1) is:(a) 5 (b) 6(c) 7 (d) 8 need solution with explaination...
Pranav Madhani
1.9k
views
Pranav Madhani
asked
May 26, 2017
Algorithms
geeksforgeeks-test-series
algorithms
recursion
+
–
1
votes
2
answers
11
Gate Sample Question
#include<stdio.h> void crazy(int n, int a, int b) { if (n ≤ 0) return; crazy(n-1, a, b + n); printf("%d %d %d\n", n, a, b); crazy(n-1, b, a + n); } int main() { crazy(3, 4, 5); 5 return 0; } (a) 1 4 10 (b) 3 4 5 2 4 8 1 4 10 1 8 6 2 4 8 3 4 ... 2 5 7 2 5 7 1 7 7 1 7 7 (c) 1 4 10 (d) 3 4 5 2 4 8 1 5 9 1 8 6 2 5 7 3 4 5 1 7 7 please need solution with explaination
#include<stdio.h>void crazy(int n, int a, int b){if (n ≤ 0) return;crazy(n-1, a, b + n);printf("%d %d %d\n", n, a, b);crazy(n-1, b, a + n);}int main(){crazy(3, 4, 5);5r...
Pranav Madhani
782
views
Pranav Madhani
asked
May 26, 2017
Algorithms
geeksforgeeks-test-series
algorithms
data-structures
recursion
+
–
0
votes
1
answer
12
Gate Sample Practise Questions
#include<stdio.h> int f(int *a, int n) { if(n ≤ 0) return 0; else if(*a % 2 = = 0) return *a + f(a+1, n-1); else return *a - f(a+1, n-1); } int main() { int a[] = {12, 7, 13, 4, 11, 6}; printf("%d", f(a, 6)); return 0; } (a) -9 (b) 5 (c) 15 (d) 19 Need explanation stepwise for solution
#include<stdio.h int f(int *a, int n) { if(n ≤ 0) return 0; else if(*a % 2 = = 0) return *a + f(a+1, n-1); else return *a - f(a+1, n-1); } int main() { int a[] = {12, 7...
Pranav Madhani
495
views
Pranav Madhani
asked
May 26, 2017
Algorithms
geeksforgeeks-test-series
recursion
identify-function
+
–
0
votes
2
answers
13
Gate Sample Practise
Which of the following is not O(n^2)? (a) (15^10) * n + 12099 (b) n^1.98 (c) n^3 / (sqrt(n)) (d) (2^20) * n
Which of the following is not O(n^2)?(a) (15^10) * n + 12099 (b) n^1.98(c) n^3 / (sqrt(n)) (d) (2^20) * n
Pranav Madhani
8.3k
views
Pranav Madhani
asked
May 25, 2017
Algorithms
geeksforgeeks-test-series
algorithms
asymptotic-notation
+
–
3
votes
1
answer
14
GeeksQuiz No of Linearly Independent Vector for Eigen value
The number of linearly independent eigen vector for eigen value 1 $\begin{bmatrix} 1 & 3 & 2 \\ 0 & 4 & 2\\ 0 &-3 & -1 \end{bmatrix}$ ... linearly independent Vector should be equal to Matrix Rank = 1 ? The ans given is No Of Unknown - Rank ( 3-1 = 2)
The number of linearly independent eigen vector for eigen value 1$\begin{bmatrix} 1 & 3 & 2 \\ 0 & 4 & 2\\ 0 &-3 & -1 \end{bmatrix}$Matrix After Substituing eigen value 1...
yg92
1.5k
views
yg92
asked
Feb 5, 2017
Linear Algebra
eigen-value
linear-algebra
engineering-mathematics
geeksforgeeks-test-series
+
–
1
votes
1
answer
15
Geeksforgeeks MOCK II COA
Can anyone solve this?? Doubts: Branch penalty should be 2. right? and what is the branch penalty for unconditional branch?
Can anyone solve this??Doubts: Branch penalty should be 2. right?and what is the branch penalty for unconditional branch?
Jason_Roy
735
views
Jason_Roy
asked
Feb 4, 2017
CO and Architecture
geeksforgeeks-test-series
co-and-architecture
+
–
1
votes
0
answers
16
GeeksforGeeks Mock 2017
why not option D?
why not option D?
Jason_Roy
313
views
Jason_Roy
asked
Jan 31, 2017
Theory of Computation
theory-of-computation
geeksforgeeks-test-series
+
–
1
votes
1
answer
17
geek mock 2017 #60
Which option is true about the SQL query given below? SELECT firstName, lastName FROM Employee WHERE lastName BETWEEN 'A%' AND 'D%'; A) It will display all the employees having last names starting with the alphabets 'A' ... excluding the names starting with 'A' and 'D since between is inclusive shouldn't D also to be included
Which option is true about the SQL query given below?SELECT firstName, lastName FROM Employee WHERE lastName BETWEEN 'A%' AND 'D%';A) It will display all the employees ha...
Pankaj Joshi
1.9k
views
Pankaj Joshi
asked
Jan 14, 2017
Databases
geeksforgeeks-test-series
databases
+
–
0
votes
1
answer
18
geeks mock 2017 #56
Which of the following statements is correct about context sensitive grammar? I) In a context sensitive grammar, ε can't be the right hand side of any production II) In a context sensitive grammar, number of grammar symbols on the left hand side of a ... non-terminals on the right hand side Isn't (II) (non contracting grammar is also CSL) and (IV) both are correct
Which of the following statements is correct about context sensitive grammar?I) In a context sensitive grammar, ε can’t be the right hand side of any productionII) In ...
Pankaj Joshi
2.9k
views
Pankaj Joshi
asked
Jan 14, 2017
Compiler Design
geeksforgeeks-test-series
compiler-design
context-sensitive
+
–
0
votes
1
answer
19
geek mock 2017 #50
Consider an array consisting of -ve and +ve numbers. What would be the worst time comparisons an algorithm can take in order to segregate the numbers having same sign altogether i.e all +ve on one side and then all -ve on the other ? N-1 N N+1 (N ... the solution says N-1 they are using using first element as pivot but shouldn't we use 0 as pivot hence N should be the answer
Consider an array consisting of –ve and +ve numbers. What would be the worst time comparisons an algorithm can take in order to segregate the numbers having same sign a...
Pankaj Joshi
1.4k
views
Pankaj Joshi
asked
Jan 14, 2017
Algorithms
geeksforgeeks-test-series
algorithms
time-complexity
+
–
1
votes
2
answers
20
binary heap
Consider a binary min heap containing n elements and every node is having degree 2 ( i.e. full binary min heap tree). What is the probability of finding the largest element at the last level ? According to my understanding the largest element has to be a leaf and since leafs can be on two levels last and second last therefore the probability should be 1/2
Consider a binary min heap containing n elements and every node is having degree 2 ( i.e. full binary min heap tree). What is the probability of finding the largest eleme...
Pankaj Joshi
2.1k
views
Pankaj Joshi
asked
Jan 14, 2017
DS
data-structures
binary-heap
geeksforgeeks-test-series
+
–
0
votes
2
answers
21
Geeks for Geeks
A and B are two sets. If |A| = 5 , |B| = 3 , then, the number of onto functions from A to B are ___ ? (A) 35 (B) 150 (C) 29 (D) 27
A and B are two sets. If |A| = 5 , |B| = 3 , then, the number of onto functions from A to B are ___ ?(A) 35(B) 150(C) 29(D) 27
Sarvottam Patel
416
views
Sarvottam Patel
asked
Jan 13, 2017
Mathematical Logic
geeksforgeeks-test-series
relations
+
–
2
votes
2
answers
22
geek mock 2017 #38
Let A = { 1,2,3,4,…….∞ } and a binary operation ‘+’ is defined by a + b = ab ∀ a,b ∈ A. Which of the following is true ? ( A, + ) is a semi group but not monoid ( A, + ) is a monoid but not group ( A, + ) is a group ( A, + ) is not a semi grou i think it should be semigroup because we dont have an identity element
Let A = { 1,2,3,4,…….∞ } and a binary operation ‘+’ is defined by a + b = ab ∀ a,b ∈ A. Which of the following is true ?( A, + ) is a semi group but not mon...
Pankaj Joshi
1.3k
views
Pankaj Joshi
asked
Jan 13, 2017
Set Theory & Algebra
geeksforgeeks-test-series
group-theory
+
–
0
votes
1
answer
23
geeks-mocks-2017
Four different pens (1, 2, 3, 4) are to be distributed at random in four pen stands marked as 1, 2, 3, 4. What is the probability that none of the pen occupies the place corresponding to its number ? a. 17/18 b. 3/8 c. 1/2 d. 5/8 How will we use the formula for derangements here? Using the direct formula of !n is giving wrong answer.
Four different pens (1, 2, 3, 4) are to be distributed at random in four pen stands marked as 1, 2, 3, 4. What is the probability that none of the pen occupies the place ...
Purple
963
views
Purple
asked
Jan 11, 2017
Quantitative Aptitude
test-series
geeksforgeeks-test-series
probability
+
–
2
votes
1
answer
24
#algo
Solve this problem?
Solve this problem?
Deepak Yadav
428
views
Deepak Yadav
asked
Jan 6, 2017
Algorithms
algorithms
recurrence-relation
geeksforgeeks-test-series
+
–
1
votes
1
answer
25
COMPARISON BASED SORT
thor
580
views
thor
asked
Nov 23, 2016
Algorithms
algorithms
time-complexity
sorting
geeksforgeeks-test-series
+
–
0
votes
2
answers
26
Time & Space Complexity
Consider the following pseudo code written in C style: bool fun(int arr[],int n,int X) { if(X == 0) return true; if(n == 0 && X !=0) return false; if(arr[n-1]*arr[n-1] > X) return fun(arr, n-1, X); return fun(arr,n-1,X) || ... Time complexity of fun() is O(n2) and it requires O(n) extra space (d) Time complexity of fun() is O(n2) and it requires O(n2) extra space
Consider the following pseudo code written in C style:bool fun(int arr[],int n,int X) { if(X == 0) return true; if(n == 0 && X !=0) return false; if(arr[n-1]*arr[n-1] X)...
$ourav
873
views
$ourav
asked
May 20, 2016
Algorithms
recursion
time-complexity
space-complexity
geeksforgeeks-test-series
+
–
1
votes
4
answers
27
GEEK_MOCK_QUETION_30
$\begin{pmatrix} 4&3 \\ 6&3 \end{pmatrix}$ What is the sum of all the elements of the $L$ and $U$ matrices as obtained in the L U decomposition? $16$ $10$ $9$ $6$
$\begin{pmatrix}4&3 \\6&3 \end{pmatrix}$What is the sum of all the elements of the $L$ and $U$ matrices as obtained in the L U decomposition?$16$$10$$9$$6$
Sumit1311
1.2k
views
Sumit1311
asked
Jan 26, 2016
Linear Algebra
geeksforgeeks-test-series
lu-decomposition
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register