Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
29
votes
5
answers
2191
GATE CSE 2017 Set 2 | Question: 15
The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the graph below? $\text{MNOPQR}$ $\text{NQMPOR}$ $\text{QMNROP}$ $\text{POQNMR}$
The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the ...
Madhav
8.1k
views
Madhav
asked
Feb 14, 2017
Algorithms
gatecse-2017-set2
algorithms
graph-algorithms
graph-search
+
–
25
votes
7
answers
2192
GATE CSE 2017 Set 2 | Question: 03
Match the algorithms with their time complexities: ... $P\rightarrow (iv) \quad Q \rightarrow(iii)\quad r \rightarrow(ii) \quad S\rightarrow(i)$
Match the algorithms with their time complexities:$$\begin{array}{|l|l|}\hline \textbf{Algorithms} & \textbf{Time Complexity} \\\hline \text{P. Tower of Hanoi with $n$...
khushtak
6.9k
views
khushtak
asked
Feb 14, 2017
Algorithms
gatecse-2017-set2
algorithms
time-complexity
match-the-following
easy
+
–
0
votes
1
answer
2193
Gate 2017 Set 1 minimum Comparisons
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required in worst case by optimal algorithm?
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required ...
yg92
214
views
yg92
asked
Feb 12, 2017
Programming in C
numerical-answers
algorithms
+
–
2
votes
1
answer
2194
Test by Bikram | Mock GATE | Test 3 | Question: 35
Consider the following set of messages with their frequencies: ... The percentage improvement for total binary stream transmission using Huffman Encoding over simple encoding is _______ %.
Consider the following set of messages with their frequencies: $$\begin{array}{|c|c|c|} \hline \textbf{Message} & \textbf{Frequency} \\ \hline A & 50\: \text{million} \...
Bikram
869
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
numerical-answers
algorithms
greedy-algorithm
huffman-code
+
–
0
votes
3
answers
2195
Test by Bikram | Mock GATE | Test 3 | Question: 23
Partitioning and Merging are the two main parts of $Quick Sort$. Which of the following is TRUE? Partitioning is the key step while Merging is trivial. Partitioning is trivial while Merging is the key step. Both Partitioning and Merging are trivial. Both Partitioning and Merging are key steps.
Partitioning and Merging are the two main parts of $Quick Sort$. Which of the following is TRUE? Partitioning is the key step while Merging is trivial. Partitioning...
Bikram
437
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
algorithms
divide-and-conquer
sorting
quick-sort
+
–
1
votes
1
answer
2196
Test by Bikram | Mock GATE | Test 3 | Question: 22
Bubble sort is used to sort the following sequence of numbers: $7 5 3 1 2 9$. What will the sequence be after the 2$^{nd}$ iteration? $1$ $2$ $3$ $5$ $7$ $9$ $3$ $1$ $2$ $5$ $7$ $9$ $5$ $3$ $1$ $2$ $7$ $9$ $3$ $5$ $7$ $1$ $2$ $9$
Bubble sort is used to sort the following sequence of numbers: $7 5 3 1 2 9$.What will the sequence be after the 2$^{nd}$ iteration?$1$ $2$ $3$ $5$ $7$ $9$$3$ $1$ $2$ $5$...
Bikram
204
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
algorithms
sorting
+
–
0
votes
1
answer
2197
Test by Bikram | Mock GATE | Test 3 | Question: 14
We write a new algorithm by considering the fact that number of comparisons required by Selection Sort can be reduced by considering elements in pairs and finding the minimum and maximum element at the same time. What will be the time complexity of the new algorithm for comparisons of Selection Sort? $O/2$ $O(n)/4$ $O(n)$ $O$(\log n)$
We write a new algorithm by considering the fact that number of comparisons required by Selection Sort can be reduced by considering elements in pairs and finding the min...
Bikram
637
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
algorithms
sorting
algorithm-design
+
–
2
votes
1
answer
2198
Linked list time complexity
Given two singly linked list of size n. The time complexity of computing the union and intersection of two linked list is. a) O(n) and O(nlogn) b) O(n) and O(n) c) O(nlogn) and O(nlogn) d) O(nlogn) and O(n)
Given two singly linked list of size n. The time complexity of computing the union and intersection of two linked list is.a) O(n) and O(nlogn)b) O(n) and O(n)c) O(nlogn) ...
Ashwani Kumar 2
1.6k
views
Ashwani Kumar 2
asked
Feb 7, 2017
Algorithms
algorithms
time-complexity
+
–
0
votes
0
answers
2199
Data Link Layer ,Crc
Is Time complexity of CRC algorithm is O(n)? n=no of bits in data field. crc , implememted in data link layer as trailer, as error detection and correction method,in Hardware.
Is Time complexity of CRC algorithm is O(n)?n=no of bits in data field.crc , implememted in data link layer as trailer, as error detection and correction method,in Hardwa...
Learner_jai
373
views
Learner_jai
asked
Feb 7, 2017
Algorithms
algorithms
computer-networks
+
–
2
votes
1
answer
2200
gatebook mt2 qn 42
The intended purpose of this code is to precompute all the primes less than N. When it is finished executing, for r ∈ [2, N), bits[r] is supposed to equal 1 if and only if N is composite. Assume that the bits array is initialized to all zeroes. for ... composite." so why cant we just do a direct search? If it is 0 its prime, otherwise composite? What is the problem in this?
The intended purpose of this code is to precompute all the primes less than N. When it is finished executing, for r ∈ [2, N), bits[r] is supposed to equal 1 if and only...
Purple
332
views
Purple
asked
Feb 7, 2017
Algorithms
algorithms
time-complexity
gatebook-test-series
+
–
0
votes
0
answers
2201
GateBook Mock Test_2(Algorithms)
The intended purpose of this code is to precompute all the primes less than N. When it is finished executing, for r ∈ [2, N), bits[r] is supposed to equal 1 if and only if N is composite. Assume that the bits array is initialized to all zeroes. for ( int x = 2; x ... number n < N is prime. (A) I only (B) I and II only (C) II and III only (D) I, II, and III
The intended purpose of this code is to precompute all the primes less than N. When it is finished executing, for r ∈ [2, N), bits[r] is supposed to equal 1 if and only...
smartmeet
473
views
smartmeet
asked
Feb 7, 2017
Algorithms
gatebook-mt2
data-structures
algorithms
space-complexity
time-complexity
+
–
2
votes
1
answer
2202
Divide and conquer
Reply with solution @Arjun sir,@habibkhan,@vijaycs
Reply with solution @Arjun sir,@habibkhan,@vijaycs
Shubham Sharma 2
1.1k
views
Shubham Sharma 2
asked
Feb 7, 2017
Algorithms
algorithms
divide-and-conquer
+
–
2
votes
5
answers
2203
Algorithm quicksort
Reply with solution @ Habibkhan,@Gabbar,@Arjun Sir
Reply with solution @ Habibkhan,@Gabbar,@Arjun Sir
Shubham Sharma 2
2.1k
views
Shubham Sharma 2
asked
Feb 7, 2017
Algorithms
algorithms
quick-sort
numerical-answers
made-easy-test-series
+
–
0
votes
1
answer
2204
worst case in quck sort
Consider a scenario of modified quick sort, where we have given an input sorted array A[1 . . . n], all elements of array are distinct and n ≥ 3. Pivot is the median of set of 3 elements [First element, middle element, and last element]. What will be worst case time complexity ... (n2) Ο(n logn) Ο(n2 logn) Ο(n log log n) I think it will be B but they have given as A....???
Consider a scenario of modified quick sort, where we have given an input sorted array A[1 . . . n], all elements of array are distinct and n ≥ 3. Pivot is the median of...
iita
1.9k
views
iita
asked
Feb 7, 2017
Algorithms
sorting
time-complexity
algorithms
+
–
0
votes
1
answer
2205
programming and ds
Let P be a QuickSort Program to sort numbers in ascending order using the first element as pivot. Let t1 and t2 be the number of comparisons made by P for the inputs {1, 2, 3, 4, 5} and {4, 1, 5, 3, 2} respectively. Which one of the following holds? A t1 = 5 B t1 < t2 C t1 > t2 D t1 = t2
Let P be a QuickSort Program to sort numbers in ascending order using the first element as pivot. Let t1 and t2 be the number of comparisons made by P for the inputs {1, ...
deepak_yadav
723
views
deepak_yadav
asked
Feb 6, 2017
Algorithms
algorithms
quick-sort
+
–
2
votes
1
answer
2206
ME test
Let f(n) = Ω(n), g(n) = O(n), h(n) = θ(n). Then [ f(n) + g(n)] - h(n) is ______________ ? A) Ω(n2) B) O(n) C) θ(n) D) None
Let f(n) = Ω(n), g(n) = O(n), h(n) = θ(n). Then [ f(n) + g(n)] - h(n) is ______________ ?A) Ω(n2)B) O(n)C) θ(n)D) None
Jithin Jayan
925
views
Jithin Jayan
asked
Feb 6, 2017
Algorithms
algorithms
time-complexity
made-easy-test-series
+
–
3
votes
0
answers
2207
NPTEL
Voting in Siruseri Zonal Computing Olympiad 2010 Elections are on for the Siruseri Town Council. Elections in Siruseri work in a rather odd manner. Each candidate is assigned a unique identification number. The town is divided into five zones and each zone proposes a list of candidates, in some ... 162 5 14 162 92 387 7 748 14 5 12 387 17 952 12 92 398 849 14 5 92 12 387 Sample Output 5
Voting in SiruseriZonal Computing Olympiad 2010Elections are on for the Siruseri Town Council. Elections in Siruseri work in a rather odd manner. Each candidate is assign...
Madhan sai
3.8k
views
Madhan sai
asked
Feb 6, 2017
Algorithms
nptel-quiz
algorithms
+
–
2
votes
1
answer
2208
Test series
Minimum time taken to find median of a list of numbers is O(log n) O(n) O(n log n) O (n2)
Minimum time taken to find median of a list of numbers isO(log n)O(n)O(n log n)O (n2)
Sanju Rakonde
397
views
Sanju Rakonde
asked
Feb 6, 2017
Algorithms
sorting
algorithms
time-complexity
+
–
1
votes
0
answers
2209
True/False
Consider the following statements : S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1) time. S2 : In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time. Which of the following is correct ? Only S1 Only S2 Both S1 and S2 None of the above
Consider the following statements :S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1)...
reena_kandari
229
views
reena_kandari
asked
Feb 6, 2017
Programming in C
algorithms
+
–
1
votes
1
answer
2210
Space complexity
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls. A)insertion sort B)quick sort C)merge sort D)selection sort
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls.A)insertion sor...
reena_kandari
1.8k
views
reena_kandari
asked
Feb 5, 2017
Programming in C
algorithms
space-complexity
sorting
+
–
0
votes
0
answers
2211
How to Calculate No of Simple graph with labelled vertices?
No of Simple Undirected Graph with unablled vertices - 2nC2 No of Simple Undirected Graph with labelled vertices - ? No of Simple Undirected Connected Graph with unablled vertices - ? No of Simple Undirected Connected Graph with labelled vertices - ?
No of Simple Undirected Graph with unablled vertices - 2nC2No of Simple Undirected Graph with labelled vertices - ?No of Simple Undirected Connected Graph with unablled v...
yg92
452
views
yg92
asked
Feb 5, 2017
Programming in C
graph-theory
graph-algorithms
data-structures
algorithms
combinatory
+
–
0
votes
1
answer
2212
MadeEasy Subject Test: Algorithms - Graph Algorithms
Will dijiktras's algoritm fail for the graph given in the question (or the question has been framed wrongly)?
Will dijiktras's algoritm fail for the graph given in the question (or the question has been framed wrongly)?
Raj Krishna
671
views
Raj Krishna
asked
Feb 5, 2017
Algorithms
algorithms
dijkstras-algorithm
made-easy-test-series
numerical-answers
+
–
0
votes
1
answer
2213
Complexity
Can someone please post the complexity for the following: Prims algorithm complexity by using adjecency matrix Prims algorithm complexity by using array Prims algorithm complexity by using min/max heap Prims algorithm complexity by using fibbonacci heap Krushkal's algorithm complexity by ... i have googled it but i want all in one place thatz why i have posted here.. please help...
Can someone please post the complexity for the following:Prims algorithm complexity by using adjecency matrixPrims algorithm complexity by using arrayPrims algorithm comp...
S Ram
503
views
S Ram
asked
Feb 4, 2017
Algorithms
time-complexity
algorithms
+
–
1
votes
1
answer
2214
recurrence realtion
$T(n) = \begin{Bmatrix} T(\frac{n}{k})+T(\frac{3n}{4})+n\ \ \ if\ n\geq2\\ 1 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ n=1 \end{Bmatrix}$
$T(n) = \begin{Bmatrix} T(\frac{n}{k})+T(\frac{3n}{4})+n\ \ \ if\ n\geq2\\ 1 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ n=1 \end{Bmatrix}$
Supremo
338
views
Supremo
asked
Feb 4, 2017
Algorithms
algorithms
time-complexity
recurrence-relation
+
–
0
votes
1
answer
2215
Non duplicate element
There is a sorted array which is of very large size. In those elements every element are repeated more than once except one element. How much time it will take to find that element? O(1) O(n) O(nlogn) O(logn) I think its less than O(log n) (divide n conquer) but solution is O(n)
There is a sorted array which is of very large size. In those elements every element are repeated more than once except one element. How much time it will take to find th...
Pankaj Joshi
314
views
Pankaj Joshi
asked
Feb 4, 2017
Algorithms
algorithms
sorting
time-complexity
+
–
1
votes
1
answer
2216
how to solve this recurrence using Recursion Tree method
T(n) = T(n-1) + n4
T(n) = T(n-1) + n4
LavTheRawkstar
793
views
LavTheRawkstar
asked
Feb 4, 2017
Algorithms
algorithms
time-complexity
asymptotic-notation
recurrence-relation
+
–
2
votes
0
answers
2217
ASYMPTOTIC GROWTH
Consider the case: f(n) = O(g(n)). Then, following two statements are claimed to be inferred from the above case. Statement I: 2f(n) = O(2g(n)) Statement II: 2g(n) = O(2f(n)) Choose the correct option from the given. Both correct. Both incorrect S1 correct, S2 false S2 false,S1 correct
Consider the case: f(n) = O(g(n)). Then, following two statements are claimed to be inferred from the above case. Statement I: 2f(n) = O(2g(n))Statement II: 2g(n) = O(2f(...
sushmita
721
views
sushmita
asked
Feb 3, 2017
Algorithms
time-complexity
asymptotic-notation
algorithms
+
–
0
votes
1
answer
2218
How to solve this Recurrence using Iteration method
$T(n) = 3 T (\frac{n}{4}) + n$
$T(n) = 3 T (\frac{n}{4}) + n$
LavTheRawkstar
1.3k
views
LavTheRawkstar
asked
Feb 3, 2017
Algorithms
algorithms
time-complexity
recurrence-relation
+
–
1
votes
1
answer
2219
Solve the Following Recurrence using Iteration Method
T(n) = 4T $(\frac{n}{3})$ + n2
T(n) = 4T $(\frac{n}{3})$ + n2
LavTheRawkstar
812
views
LavTheRawkstar
asked
Feb 3, 2017
Algorithms
algorithms
time-complexity
asymptotic-notation
recurrence-relation
+
–
0
votes
0
answers
2220
Topological sorting
My ques. is not the no. of topological sort as i have computed it myself. My problem is can someone please telll me a efficient approach as tree method is taking a lot of time here, like by use of combinatorics, can we find it easily, i.e in less time. and if possible, pls provide general approach apart from tree method.
My ques. is not the no. of topological sort as i have computed it myself. My problem is can someone please telll me a efficient approach as tree method is taking a lot of...
mohit chawla
2.3k
views
mohit chawla
asked
Feb 3, 2017
Algorithms
topological-sort
made-easy-test-series
algorithms
+
–
Page:
« prev
1
...
69
70
71
72
73
74
75
76
77
78
79
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register