Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sorting
0
votes
1
answer
211
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.2k
views
pradeepchaudhary
asked
Jul 8, 2018
Algorithms
algorithms
sorting
geeksforgeeks-test-series
+
–
1
votes
2
answers
212
Radix sort
Pradeep Verma
508
views
Pradeep Verma
asked
Jul 7, 2018
Algorithms
sorting
radix-sort
test-series
+
–
3
votes
2
answers
213
Quick Sort Time Complexity
Quick sort gives O(nlogn) worst case performance if the pivot is selected as: a) First element of the array b) Median of first, last and middle elements c) Arithmetic mean of the elements d) None of these Now, the answer is given as Option (b). But, ... order of elements and not on pivot element. So, answer should be option (d) i.e None of these Correct me if I am wrong
Quick sort gives O(nlogn) worst case performance if the pivot is selected as:a) First element of the arrayb) Median of first, last and middle elementsc) Arithmetic mean o...
garvit_vijai
3.4k
views
garvit_vijai
asked
Jul 1, 2018
Algorithms
quick-sort
sorting
time-complexity
+
–
0
votes
1
answer
214
time complexity
Q- consider an array A of size K where each element is either 10 or 20 what is the minimum time required to sort an array A??????
Q- consider an array A of size K where each element is either 10 or 20 what is the minimum time required to sort an array A??????
Lokesh Arya
275
views
Lokesh Arya
asked
Jul 1, 2018
Algorithms
sorting
time-complexity
+
–
1
votes
2
answers
215
Ace Question 10
Na462
548
views
Na462
asked
Jun 29, 2018
Algorithms
merge-sort
ace-test-series
sorting
+
–
0
votes
1
answer
216
Time complexity analysis
What will be the time complexity if fractional knapsack is implemented using min heap instead of sorted array a) O(nlogn) b)O(n^2) c)O(n) d) none of these
What will be the time complexity if fractional knapsack is implemented using min heap instead of sorted arraya) O(nlogn)b)O(n^2)c)O(n)d) none of these
Rohit Pandey
788
views
Rohit Pandey
asked
Jun 27, 2018
Algorithms
time-complexity
knapsack-problem
sorting
binary-heap
+
–
0
votes
1
answer
217
Binary search
Find the average number of comparisons in a binary search on a sorted array of 10 consecutive integers starting from 1. 1) 2.6 2)2.7 3)2.8 4)2.9
Find the average number of comparisons in a binary search on a sorted array of 10 consecutive integers starting from 1.1) 2.62)2.73)2.84)2.9
shweta sah
835
views
shweta sah
asked
Jun 22, 2018
Algorithms
binary-search
sorting
+
–
0
votes
1
answer
218
Made easy workbook
We've been given an unordered list having n distinct elements,the no. Of comparison to find an element that is neither the 2nd minimum nor the 2nd maximum is?
We've been given an unordered list having n distinct elements,the no. Of comparison to find an element that is neither the 2nd minimum nor the 2nd maximum is?
Manoj Kumar Pandey
312
views
Manoj Kumar Pandey
asked
Jun 20, 2018
Algorithms
made-easy-booklet
sorting
time-complexity
+
–
0
votes
3
answers
219
Binary search
Given a sorted array of n elements where other than one element x every other elenent repeat two times then how much time will it take to find position of x
Given a sorted array of n elements where other than one element x every other elenent repeat two times then how much time will it take to find position of x
Shankar Jha
1.0k
views
Shankar Jha
asked
Jun 16, 2018
Algorithms
sorting
time-complexity
+
–
0
votes
0
answers
220
Sorting
You are asked to sort 15 randomly generated numbers. One should prefer - 1. Bubble Sort 2. Quick Sort 3. Merge Sort 4. Heap Sort Please explain why others 3 sorting algorithms except the answer can't be used ?
You are asked to sort 15 randomly generated numbers. One should prefer - 1. Bubble Sort2. Quick Sort3. Merge Sort4. Heap Sort Please explain why others 3 sorting algorith...
Rahul Ranjan 1
669
views
Rahul Ranjan 1
asked
Jun 15, 2018
Algorithms
sorting
algorithms
time-complexity
heap-sort
merge-sort
+
–
0
votes
1
answer
221
You want to check whether a given set of items is sorted or not
.You want to check whether a given set of items is sorted or not.Which of the following sorting methods will be the most efficient if it is already in sorted order? a. Bubble sort b. Selection sort c. Insertion sort d.Merge sort
.You want to check whether a given set of items is sorted or not.Which of the following sorting methods will be the most efficient if it is already in sorted order?a. Bub...
Sanjay Sharma
3.7k
views
Sanjay Sharma
asked
Jun 15, 2018
Algorithms
sorting
+
–
0
votes
1
answer
222
Made easy workbook
Assume that merge sort algorithm in the worst case takes 30 seconds for an input of size 64 which of The following most closely approximates the maximum input size of a problem that can be solved in 6 minutes
Assume that merge sort algorithm in the worst case takes 30 seconds for an input of size 64 which of The following most closely approximates the maximum input size of a p...
Shankar Jha
598
views
Shankar Jha
asked
Jun 15, 2018
Algorithms
made-easy-booklet
sorting
merge-sort
time-complexity
+
–
0
votes
1
answer
223
workbook
An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither 2nd maximum nor 2nd minimum is Θ(nlogn) Θ(n) Θ(logn) Θ(1)
An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither 2nd maximum nor 2nd minimum isΘ(nlogn)Θ(n)Θ(l...
eyeamgj
541
views
eyeamgj
asked
Jun 15, 2018
Algorithms
algorithms
time-complexity
easy
sorting
+
–
1
votes
0
answers
224
GATE Suitability Test | Test 1 | Question: 1
Given a sequence of numbers where numbers at odd positions as well as even positions are sorted in increasing order. For example 1 42 3 44 6 45 9 Which of the following sorting algorithm performs the best here ... of comparisons performed? Insertion sort Bubble sort Selection sort Asymptotically all the above three have the same worst case performance
Given a sequence of numbers where numbers at odd positions as well as even positions are sorted in increasing order. For example1 42 3 44 6 45 9Which of the following so...
Arjun
275
views
Arjun
asked
Jun 10, 2018
Algorithms
gate-suitability-test-1
sorting
+
–
1
votes
1
answer
225
Sorting
Which sorting algorithm is good if we already knew the range of number - Counting Sort OR Radix Sort
Which sorting algorithm is good if we already knew the range of number -Counting Sort OR Radix Sort
jatinkumar
838
views
jatinkumar
asked
Jun 5, 2018
DS
sorting
time-complexity
algorithms
+
–
0
votes
1
answer
226
merge sort
Why do we say Merge sort makes good use of locality of reference? and if I have $1 \hspace{0.1cm} billion$ elements and my memory can only store $1 \hspace{0.1cm} million$ elements at a time. How would I use merge sort to sort this?
Why do we say Merge sort makes good use of locality of reference? and if I have $1 \hspace{0.1cm} billion$ elements and my memory can only store $1 \hspace{0.1cm} million...
Kiran Karwa
1.1k
views
Kiran Karwa
asked
May 26, 2018
Algorithms
algorithms
merge-sort
sorting
+
–
1
votes
1
answer
227
Sorting
Which of the following sorting techniques have minimum number of comparision in best case? 1. Insertion Sort 2. Selection Sort 3. Merge Sort 4. Heap Sort 5.Quick Sort The answer is insertion sort but my doubt is in insertion sort algo. inside the for loop the while ... in best case.Wont it have O(n^2) Comparisons.Becasue comparisons will be done in all the cases weather its sorted or not.
Which of the following sorting techniques have minimum number of comparision in best case?1. Insertion Sort2. Selection Sort3. Merge Sort4. Heap Sort5.Quick Sort The answ...
Na462
2.5k
views
Na462
asked
May 6, 2018
Algorithms
sorting
algorithms
+
–
0
votes
2
answers
228
BITS HD
To sort the following numbers which algorithm will suit the best (i) 1 to 100 integers (ii) 0 to 1000000 integers a)bucket sort for both b) (i)radix sort (ii)quick sort c) (i)quick sort (ii)merge sort d) (i) merge sort (ii)quick sort
To sort the following numbers which algorithm will suit the best (i) 1 to 100 integers (ii) 0 to 1000000 integers ...
Sayan Bose
1.5k
views
Sayan Bose
asked
May 4, 2018
Algorithms
bits-hd
algorithms
sorting
+
–
1
votes
0
answers
229
MadeEasy Test Series: Algorithms - Sorting
Please Justify Statements which are true and which are false by an Example: Consider the following statements : S1 :While performing quick sort at any iteration only 1 element can be present at its correct position. S2 : The running time of ... ' passes in order to solve the single source shortest path problem on G'. Which of the following is correct ?
Please Justify Statements which are true and which are false by an Example:Consider the following statements :S1 :While performing quick sort at any iteration only 1 ele...
Na462
1.4k
views
Na462
asked
Apr 30, 2018
Algorithms
made-easy-test-series
algorithms
sorting
bellman-ford
+
–
2
votes
2
answers
230
ISRO2018-66
Of the following sorting algorithms, which has a running time that is least dependent on the initial ordering of the input? Mege Sort Insertion Sort Selection Sort Quick Sort
Of the following sorting algorithms, which has a running time that is least dependent on the initial ordering of the input?Mege SortInsertion SortSelection SortQuick Sort...
Arjun
5.5k
views
Arjun
asked
Apr 22, 2018
Algorithms
isro2018
algorithms
sorting
+
–
5
votes
2
answers
231
PGEE 2018
Given an array of n elements, where each element is at most k away from its target position, which algorithm is best suitable for sorting and what will be time complexity of the algorithm ( Note since pgee paper are not provided I am unable to recall options)
Given an array of n elements, where each element is at most k away from its target position, which algorithm is best suitable for sorting and what will be time complexity...
Tesla!
912
views
Tesla!
asked
Apr 21, 2018
Algorithms
iiith-pgee
algorithms
sorting
+
–
1
votes
3
answers
232
MY DOUBT: Worst case space complexity of Quick sort (NOT FOR A STRAIGHT ANSWER)
First read it properly. I am not asking a specific question about space complexity. Question: What is worst case space complexity of quick sort? Everywhere it is showing O(logn). My understanding about it: I know that Quick ... by ratio 1:n-1 which is worst case, wouldn't it be requesting for O(n) stack records?
First read it properly. I am not asking a specific question about space complexity.Question: What is worst case space complexity of quick sort?Everywhere it is showing O(...
Akash Kumar Roy
2.4k
views
Akash Kumar Roy
asked
Apr 21, 2018
DS
algorithms
sorting
data-structures
space-complexity
+
–
2
votes
1
answer
233
Sorting
pankaj_vir
1.5k
views
pankaj_vir
asked
Mar 19, 2018
Algorithms
test-series
sorting
algorithms
heap-sort
radix-sort
+
–
3
votes
1
answer
234
Online and Offline Sorting Algorithms
How to know that whether a sorting algorithm is online or offline ? For example , Insertion sort is online but Merge Sort is offline..Please explain ..
How to know that whether a sorting algorithm is online or offline ? For example , Insertion sort is online but Merge Sort is offline..Please explain ..
ankitgupta.1729
2.9k
views
ankitgupta.1729
asked
Mar 18, 2018
Algorithms
algorithms
sorting
+
–
1
votes
1
answer
235
Merge sort algorithm
Consider the modified merge sort where we divide array into 5 equal sub arrays instead if 2(as in standard merge sort).What is the time complexity if modified merge sort? Is there any improvement over standard merge sort?
Consider the modified merge sort where we divide array into 5 equal sub arrays instead if 2(as in standard merge sort).What is the time complexity if modified merge sort?...
rahul sharma 5
1.3k
views
rahul sharma 5
asked
Mar 9, 2018
Algorithms
algorithms
merge-sort
sorting
time-complexity
+
–
3
votes
1
answer
236
An array A is of length n has log( n) distinct numbers. What is the time complexity
An array A is of length n has log( n) distinct numbers. What is the time complexity of sorting A by best comparison based algorithm ?
An array A is of length n has log( n) distinct numbers.What is the time complexity of sorting A by best comparison based algorithm ?
Sanjay Sharma
1.1k
views
Sanjay Sharma
asked
Feb 20, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
3
answers
237
Radix Sort Problem
The complexity of Radix Sort is $O(wn)$, for $n$ keys which are integers of word size $w$. Here, $w=log_2(n^k)=k\times log_2(n)$ So, the complexity is $O(wn)=O(k\times log_2(n)\times n)$ For instance if size is $n^3$ the complexity ... Then why we say radix sort sorts the input in linear time? Similar Concept used to solve : https://gateoverflow.in/3353/gate2008-it-43
The complexity of Radix Sort is $O(wn)$, for $n$ keys which are integers of word size $w$.Here, $w=log_2(n^k)=k\times log_2(n)$So, the complexity is $O(wn)=O(k\times log_...
Na462
1.0k
views
Na462
asked
Feb 19, 2018
Algorithms
algorithms
radix-sort
time-complexity
sorting
+
–
7
votes
2
answers
238
CMI2017-A-08
A $\text{stable sort}$ preserves the order of values that are equal with respect to the comparison function. We have a list of three-dimensional points $[(7, 1, 8),(3, 5, 7),(6, 1, 4),(6, 5, 9),(0, 2, 5),(9, 0, 9)].$ We sort these in ascending order by the second coordinate. Which of the following ... $[(9, 0, 9),(6, 1, 4),(7, 1, 8),(0, 2, 5),(3, 5, 7),(6, 5, 9)]$
A $\text{stable sort}$ preserves the order of values that are equal with respect to the comparison function. We have a list of three-dimensional points$[(7, 1, 8),(3, 5, ...
Tesla!
2.1k
views
Tesla!
asked
Feb 4, 2018
Algorithms
cmi2017
algorithms
sorting
+
–
1
votes
1
answer
239
me test series
Given two unsorted singly-linked lists each with n distinct elements. There exists an efficient intersection algorithm, that computes and returns a new list with common elements between the input lists. How much time does the intersection algorithm requires in worst case, if it is allowed to ... only? answer is qiven as O(nlogn)...........i think it should be O(n^2)...please verify
Given two unsorted singly-linked lists each with n distinct elements. There exists an efficient intersection algorithm, that computes and returns a new list with common e...
eyeamgj
956
views
eyeamgj
asked
Jan 29, 2018
Algorithms
made-easy-test-series
time-complexity
sorting
+
–
1
votes
2
answers
240
Worst Case Time Complexity
What is the worst case time complexity to find kth smallest element into an array of ‘n’ element?
What is the worst case time complexity to find kth smallest element into an array of ‘n’ element?
vishal chugh
1.8k
views
vishal chugh
asked
Jan 24, 2018
DS
algorithms
time-complexity
data-structures
sorting
+
–
Page:
« prev
1
...
3
4
5
6
7
8
9
10
11
12
13
...
19
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register