Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sorting
3
votes
4
answers
121
MadeEasy Test Series: Algorithms - Sorting
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 of modified quick sort? a.O($n^{2}$) b.O(nlogn) c.O($n^{2}$logn) d.O(nloglogn)
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 se...
newdreamz a1-z0
1.5k
views
newdreamz a1-z0
asked
Jan 21, 2019
Algorithms
algorithms
sorting
quick-sort
made-easy-test-series
+
–
1
votes
1
answer
122
Self Doubt
The average no. of comparisons performed by the merge sort algorithm, in merging 2 sorted lists of length 2 is___________. Ans: $\frac{8}{3}$
The average no. of comparisons performed by the merge sort algorithm, in merging 2 sorted lists of length 2 is___________.Ans: $\frac{8}{3}$
kumar.dilip
664
views
kumar.dilip
asked
Jan 19, 2019
Algorithms
algorithms
merge-sort
sorting
+
–
0
votes
1
answer
123
Self Doubt Algorithms
When relative ordering of equal keys is preserved after sorting then it is called stable. Quick sort and heap sort is not a stable sorting algorithm . Doubt---IS Selection sort not a stable sorting algorithm ?
When relative ordering of equal keys is preserved after sorting then it is called stable. Quick sort and heap sort is not a stable sorting algorithm . Doubt -IS Select...
Prince Sindhiya
323
views
Prince Sindhiya
asked
Jan 19, 2019
Algorithms
algorithms
sorting
+
–
2
votes
1
answer
124
sorted list
we are given (log m) sorted list each of size (log n) / (log m) the time complexity of merging list into single sorted list using mergesort is equal to a) O ( log m log(log n) ) b) O ( log n log(log m) ) c) O ( log m log n) d) O ( m log log n)
we are given (log m) sorted list each of size (log n) / (log m) the time complexity of merging list into single sorted list using mergesort is equal to a) O ( log m log(l...
Rahul_Rathod_
887
views
Rahul_Rathod_
asked
Jan 16, 2019
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
0
answers
125
ME_test_series
An array A of size n is known to be sorted except for the first k elements and the last k elements, where K is a constant. Which of the following algorithms will be the best choice for sorting the array A? A.) quick sort B.) insertion sort C.) selection sort D.) bubble sort I can’t understand how can insertion sort be better in this case?
An array A of size n is known to be sorted except for the first k elements and the last k elements, where K is a constant. Which of the following algorithms will be the b...
Shivam Kasat
450
views
Shivam Kasat
asked
Jan 13, 2019
Algorithms
algorithms
sorting
+
–
0
votes
2
answers
126
ME TEST SERIES
Shankar Kakde
244
views
Shankar Kakde
asked
Jan 10, 2019
Algorithms
sorting
made-easy-test-series
+
–
0
votes
0
answers
127
Merge Sort
Can anyone help me to understand this problem….??
Can anyone help me to understand this problem….??
Vikas123
994
views
Vikas123
asked
Jan 8, 2019
Algorithms
merge-sort
algorithms
sorting
merging
+
–
0
votes
1
answer
128
UPPCL AE 2018:46
Which one of the following algorithms cannot sort $n$ numbers in $O(n)$ comparisons? Counting sort Radix sort Heap sort Bucket sort
Which one of the following algorithms cannot sort $n$ numbers in $O(n)$ comparisons?Counting sortRadix sortHeap sortBucket sort
admin
475
views
admin
asked
Jan 5, 2019
Algorithms
uppcl2018
algorithms
sorting
+
–
0
votes
1
answer
129
UPPCL AE 2018:20
Which of the following is not a stable sorting algorithm in its typical implementation? Merge sort Bubble sort Quick sort Insertion sort
Which of the following is not a stable sorting algorithm in its typical implementation?Merge sortBubble sortQuick sortInsertion sort
admin
280
views
admin
asked
Jan 5, 2019
Algorithms
uppcl2018
algorithms
sorting
+
–
0
votes
0
answers
130
UGC NET CSE | December 2018 | Part 2 | Question: 30
The second smallest of $n$ elements can be found with ____ comparisons in the worst case. $n-1$ $\lg \: n$ $n + ceil(\lg \: n)-2$ $\frac{3n}{2}$
The second smallest of $n$ elements can be found with ____ comparisons in the worst case.$n-1$$\lg \: n$$n + ceil(\lg \: n)-2$$\frac{3n}{2}$
Arjun
1.1k
views
Arjun
asked
Jan 2, 2019
Unknown Category
ugcnetcse-dec2018-paper2
algorithms
sorting
+
–
0
votes
0
answers
131
MadeEasy Test Series: Programming & DS - Sorting
An array A of size n is known to be sorted except for the first k elements and the last k elements, where k is a constant. Which of the following algorithms will be the best choice for sorting the array A? a-Insertion Sort b-Bubble sort c-Quicksort d-Selection sort
An array A of size n is known to be sorted except for the first k elements and the last k elements, where k is a constant. Which of the following algorithms will be the b...
Shamim Ahmed
611
views
Shamim Ahmed
asked
Jan 1, 2019
DS
data-structures
made-easy-test-series
sorting
+
–
6
votes
1
answer
132
GATE Overflow | Mock GATE | Test 1 | Question: 62
Which of the following sorting algorithms performs efficiently to sort a singly linked list containing $\log n$ nodes and the corresponding time complexity is? $\text{Insertion sort, } O(\log ^2 n)$ $\text{Merge sort, } \Theta (( \log n) \log (\log n ))$ $\text{Heap sort, } \Theta ( \log ^2)(\log n ))$ $\text{Quick sort, } O ( \log 2)(\log n ))$
Which of the following sorting algorithms performs efficiently to sort a singly linked list containing $\log n$ nodes and the corresponding time complexity is?$\text{Inse...
Ruturaj Mohanty
1.5k
views
Ruturaj Mohanty
asked
Dec 27, 2018
Algorithms
go-mockgate-1
data-structures
linked-list
sorting
algorithms
+
–
1
votes
1
answer
133
Highest best case implies worst case?
Which of the below given sorting techniques has highest best-case runtime complexity. (A) Quick sort (B) Selection sort (C) Insertion sort (D) Bubble sort Answer: (B) Explanation: Quick sort best case time complexity is Ο(n logn) Selection sort ... -12/ I did not understand this as best case time should be O(n) sorting method what does highest best cases mean?
Which of the below given sorting techniques has highest best-case runtime complexity.(A) Quick sort(B) Selection sort(C) Insertion sort(D) Bubble sortAnswer: (B)Explanati...
sripo
8.8k
views
sripo
asked
Dec 23, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
0
answers
134
Self Doubt
Please correct if any of the point is wrong : Quicksort: 1.Need more random accesses 2 Used when Random access is fast (hence preferred on array and not on Linked List) 2 No extra space needed ==> Inplace 4 Not a stable sorting algorithm ... : Quicksort in particular exhibits good cache locality and this makes it faster than merge sort in many cases like in virtual memory environment.
Please correct if any of the point is wrong :Quicksort:1.Need more random accesses2 Used when Random access is fast (hence preferred on array and not on Linked List)2 No ...
jatin khachane 1
755
views
jatin khachane 1
asked
Dec 21, 2018
Programming in C
programming
data-structures
sorting
+
–
0
votes
1
answer
135
cormen 7.2 -5
Suppose that the splits at every level of quicksort are in the proportion 1 - α to α, where 0 < α ≤ 1/2 is a constant. Show that the minimum depth of a leaf in the recursion tree is approximately - lg n/ lg α ... procede with this problem i had seen stackoverflow solution but couldn't understand https://stackoverflow.com/questions/17684680/maximum-and-minimum-depth-of-quicksort
Suppose that the splits at every level of quicksort are in the proportion 1 - α to α, where 0 < α ≤ 1/2 is a constant. Show that the minimum depth of a leaf in the r...
vijju532
1.1k
views
vijju532
asked
Dec 21, 2018
Algorithms
algorithms
sorting
data-structures
recursion
cormen
+
–
2
votes
4
answers
136
MadeEasy Subject Test 2019: Algorithms - Sorting
Suppose there are 4 sorted list of 16 elements each. If we merge these lists into a single sorted list of 64 elements. The key comparisons that are needed in the worst case using an efficient algorithm are
Suppose there are 4 sorted list of 16 elements each. If we merge these lists into a single sorted list of 64 elements. The key comparisons that are needed in the worst ca...
Ramij
2.3k
views
Ramij
asked
Dec 20, 2018
Algorithms
made-easy-test-series
algorithms
sorting
merge-sort
+
–
0
votes
0
answers
137
MadeEasy Test Series: Algorithms - Sorting
Which of the following sorting algorithm represented by above code?
Which of the following sorting algorithm represented by above code?
Abhishek Kumar 38
611
views
Abhishek Kumar 38
asked
Dec 19, 2018
Algorithms
made-easy-test-series
algorithms
sorting
+
–
2
votes
1
answer
138
bubble sort
How many passes of bubble sort are required to sort the following sequence (Pass is counted only when at least one swap is performed in the bubble sort pass)? 12, 15, 17, 11, 14, 13 (a) 6 (b) 5 (c) 4 (d) 3 I am getting ans as 3 but given answer in 4. please verify it
How many passes of bubble sort are required to sort the following sequence (Pass is counted only when at least one swap is performed in the bubble sort pass)? ...
Mak Indus
5.5k
views
Mak Indus
asked
Dec 18, 2018
Algorithms
bubble-sort
sorting
+
–
0
votes
1
answer
139
MadeEasy Subject Test 2019: Algorithms - Sorting
Which of the following input will give best case time for selection sort? (A) 1 2 3 4 5 6 7 8 9 10 (B) 2 3 1 5 9 7 8 6 10 (C) 10 9 8 7 6 5 4 3 2 1 (D) All of above take same amount of time
Which of the following input will give best case time for selection sort?(A) 1 2 3 4 5 6 7 8 9 10(B) 2 3 1 5 9 7 8 6 10(C) 10 9 8 7 6 5 4 3 2 1 (D) All of above take same...
Rajat Agrawal007
4.5k
views
Rajat Agrawal007
asked
Dec 17, 2018
Algorithms
made-easy-test-series
algorithms
sorting
+
–
2
votes
1
answer
140
MadeEasy Test Series: Algorithms - Sorting
An array of size n is known to be sorted except for the 1st k elements and the last k elements, where k is a constant. which of the following algorithm is the best choice for sorting the array A? Quick Sort or Insertion Sort? given answer is the insertion ... k), and it will take O(klogk) in average case and O(k^2) in the worst case. what's wrong in that?
An array of size n is known to be sorted except for the 1st k elements and the last k elements, where k is a constant. which of the following algorithm is the best choice...
aambazinga
818
views
aambazinga
asked
Dec 15, 2018
Algorithms
made-easy-test-series
algorithms
sorting
+
–
0
votes
0
answers
141
Self doubt
The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is The tightest upper bound on the number of comparisons, in the worst case, for comparison-based sorting is The tightest lower bound on the number of ... comparison-based sorting is The tightest upper bound on the number of comparisons, in the best case, for comparison-based sorting is
The tightest lower bound on the number of comparisons, in the worst case, for comparison-based sorting is The tightest upper bound on the number of comparisons, in the wo...
jatin khachane 1
315
views
jatin khachane 1
asked
Dec 13, 2018
Algorithms
algorithms
sorting
+
–
0
votes
0
answers
142
made_easy_test_2019 (Algorithms)
explain how to solve the above question !
explain how to solve the above question !
air1ankit
494
views
air1ankit
asked
Dec 11, 2018
Algorithms
algorithms
sorting
+
–
0
votes
1
answer
143
Ace test series
abhishekmehta4u
291
views
abhishekmehta4u
asked
Dec 8, 2018
Algorithms
algorithms
sorting
time-complexity
array
ace-test-series
+
–
1
votes
1
answer
144
NIELIT 2018-47
______ sorting algorithms has the lowest worst-case complexity. Selection Sort Bubble Sort Merge Sort Quick Sort
______ sorting algorithms has the lowest worst-case complexity.Selection SortBubble SortMerge SortQuick Sort
Arjun
16.9k
views
Arjun
asked
Dec 7, 2018
Algorithms
nielit-2018
algorithms
sorting
+
–
1
votes
2
answers
145
GATE CSE 2003 | Question: 22 Self doubt
The unusual $\Theta(n^2)$ implementation of Insertion Sort to sort an array uses linear search to identify the position where an element is to be inserted into the already sorted part of the array. If, instead, we use binary search to ... will be O(nlogn) because here no matter what the binary search will be performed for every element. Can someone confirm?
The unusual $\Theta(n^2)$ implementation of Insertion Sort to sort an array uses linear search to identify the position where an element is to be inserted into the alread...
Mk Utkarsh
999
views
Mk Utkarsh
asked
Dec 3, 2018
Algorithms
algorithms
sorting
+
–
1
votes
2
answers
146
Adaptive sorting Algorithm.
Is Quick sort an adaptive sorting Algorithm? I think no. Because as per the definition given in the Wikipedia is that A adaptive sorting Algorithm is one who takes the advantage of preorderedness of the input. But in case of Quick sort it act as disadvantage.
Is Quick sort an adaptive sorting Algorithm? I think no. Because as per the definition given in the Wikipedia is that A adaptive sorting Algorithm is one who takes the ad...
Shubhanshu
5.0k
views
Shubhanshu
asked
Dec 1, 2018
Algorithms
algorithms
sorting
quick-sort
merge-sort
+
–
0
votes
1
answer
147
Self Doubt
Please explain me the difference between the following questions and their answers. All seems similar to me with different answers. https://gateoverflow.in/2048/gate2014-3-14 https://gateoverflow.in/1830/gate2006-52 https://gateoverflow.in/25209/tifr2012-b-14
Please explain me the difference between the following questions and their answers. All seems similar to me with different answers.https://gateoverflow.in/2048/gate2014-3...
Gupta731
304
views
Gupta731
asked
Nov 30, 2018
Algorithms
algorithms
sorting
+
–
0
votes
0
answers
148
Test MadeEasy
What will be the answer of this question?
What will be the answer of this question?
Avir Singh
460
views
Avir Singh
asked
Nov 27, 2018
Algorithms
sorting
time-complexity
+
–
0
votes
0
answers
149
made easy
Suppose P,Q,R,S,T are sorted sequences having lengths 20,30,35,50 respectively.They are to be merged into a single sequence by merging together two sequences at a time.The number of comparisons that will be needed in the worst case by the optimal algorithm for doing this is
Suppose P,Q,R,S,T are sorted sequences having lengths 20,30,35,50 respectively.They are to be merged into a single sequence by merging together two sequences at a time.Th...
Piyush mishra
254
views
Piyush mishra
asked
Nov 27, 2018
Algorithms
sorting
+
–
0
votes
1
answer
150
Merge Sort Inplace
no of comparisons in merge sort max? how many max no swaps??[if inplace algo]
no of comparisons in merge sort max?how many max no swaps??[if inplace algo]
Abhisek Tiwari 4
623
views
Abhisek Tiwari 4
asked
Nov 24, 2018
Algorithms
algorithms
sorting
merge-sort
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
...
19
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register