Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sorting
0
votes
1
answer
301
complexity analysis
Space complexity = input size + extra space So, heap sort also takes input of an 'n' size array. Does this mean that space cost of heap sort algo is O (n).
Space complexity = input size + extra spaceSo, heap sort also takes input of an 'n' size array.Does this mean that space cost of heap sort algo is O (n).
Suryakant
727
views
Suryakant
asked
Jun 30, 2017
Algorithms
space-complexity
sorting
heap-sort
+
–
2
votes
3
answers
302
Finding the second element neither minimum nor maximum
How many comparisons are there for finding any second element that is neither minimum or maximum. 10 5 50 70 80 2 3
How many comparisons are there for finding any second element that is neither minimum or maximum.10 5 50 70 80 2 3
gari
1.2k
views
gari
asked
Jun 21, 2017
Algorithms
algorithms
time-complexity
sorting
+
–
6
votes
3
answers
303
Merge Sort Comparisons
Q . In the standard merge sort algorithm on a list of size n, what is the maximum number of times an item can be compared? a)2 b)logn c)n-1 d)NOT My doubt is here ,Are we considering a specific Item throughout our Analysis.?
Q . In the standard merge sort algorithm on a list of size n, what is the maximum number of times an item can be compared?a)2b)lognc)n-1d)NOTMy doubt is here ,Are we cons...
imamitk9
3.4k
views
imamitk9
asked
Jun 20, 2017
Algorithms
algorithms
merge-sort
sorting
+
–
1
votes
2
answers
304
geeksforgeeks
In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort? A N(logN base 3) B N(logN base 2/3) C N(logN base 1/3) D N(logN base 3/2)
In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?AN(...
Bhavana Giri 10
7.0k
views
Bhavana Giri 10
asked
Jun 14, 2017
Algorithms
algorithms
sorting
merge-sort
time-complexity
+
–
0
votes
1
answer
305
DSSB_2017
A sorting algorithm is called stable if 1.It takes O(n log n) time 2.It maintains relative order of occurrence of non-distinct elements 3.It uses divide and conquer paradigm 4.It takes linear time
A sorting algorithm is called stable if1.It takes O(n log n) time2.It maintains relative order of occurrence of non-distinct elements3.It uses divide and conquer paradig...
Harikesh Kumar
803
views
Harikesh Kumar
asked
Jun 12, 2017
Algorithms
sorting
time-complexity
+
–
1
votes
3
answers
306
Self doubt
You are asked to sort 15 randomly generated numbers. One should prefer— (a) Bubble sort (b) Quick sort (c) Merge sort (d) Heap sort I think the answer should be c or d crct me???
You are asked to sort 15 randomly generated numbers. One should prefer—(a) Bubble sort (b) Quick sort (c) Merge sort (d) Heap sortI think the answer should be c or d cr...
Shubhanshu
1.6k
views
Shubhanshu
asked
Jun 6, 2017
Algorithms
algorithms
sorting
merge-sort
heap-sort
+
–
4
votes
2
answers
307
Sorting
We need to sort 7 numbers each of 4 digits. What is the number of comparisons in worst case . Options are as follows: 1) 40 2) 38 3) 47 4) 280
We need to sort 7 numbers each of 4 digits. What is the number of comparisons in worst case . Options are as follows:1) 402) 383) 474) 280
Nisha kumari
1.3k
views
Nisha kumari
asked
Jun 4, 2017
DS
sorting
+
–
0
votes
2
answers
308
Sorting and Searching
l
l
Hardik1997
845
views
Hardik1997
asked
May 26, 2017
Algorithms
sorting
time-complexity
algorithms
gateforum-test-series
+
–
0
votes
1
answer
309
Doubt
CAn anyone explian about 2-way merge sort ? (You can take example from GATE1999-1.14, ISRO2015-42)
CAn anyone explian about 2-way merge sort ?(You can take example from GATE1999-1.14, ISRO2015-42)
Angkit
337
views
Angkit
asked
May 14, 2017
Algorithms
sorting
merge-sort
+
–
0
votes
1
answer
310
Algorithms
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 ...
Vasu_gate2017
505
views
Vasu_gate2017
asked
May 14, 2017
Algorithms
sorting
+
–
2
votes
1
answer
311
Test by Bikram | Mock GATE | Test 4 | Question: 24
An unsorted array has this property that every element in it is at most $d$ distance from its position in the sorted version of the array (where $d$ is a positive integer smaller than the size of the array). Which among the following algorithms is best suited to sort this array? Insertion Sort Quick Sort Heap Sort Merge Sort
An unsorted array has this property that every element in it is at most $d$ distance from its position in the sorted version of the array (where $d$ is a positive integer...
Bikram
617
views
Bikram
asked
May 14, 2017
Algorithms
tbb-mockgate-4
algorithms
sorting
+
–
3
votes
2
answers
312
Quick sort algorithm selects (n/5)th element as the smallest element
Please show the working
Please show the working
rahuldb
2.6k
views
rahuldb
asked
May 10, 2017
Algorithms
algorithms
sorting
time-complexity
test-series
+
–
9
votes
5
answers
313
ISRO2017-49
The number of swappings needed to sort the numbers $8 , 22, 7, 9, 31, 5, 13$ in ascending order using bubble sort is $11$ $12$ $13$ $10$
The number of swappings needed to sort the numbers $8 , 22, 7, 9, 31, 5, 13$ in ascending order using bubble sort is$11$$12$$13$$10$
sh!va
8.0k
views
sh!va
asked
May 7, 2017
Algorithms
isro2017
algorithms
sorting
+
–
10
votes
5
answers
314
ISRO2017-15
Which one of the following in-place sorting algorithms needs the minimum number of swaps? Insertion Sort Quick Sort Heap Sort Selection Sort
Which one of the following in-place sorting algorithms needs the minimum number of swaps?Insertion SortQuick SortHeap SortSelection Sort
sh!va
4.9k
views
sh!va
asked
May 7, 2017
Algorithms
isro2017
algorithms
sorting
+
–
0
votes
1
answer
315
#Algorithms
Can somebody help me out to figure out an algorithm that would work in O(nlogn) for the following problem? Given a SORTED array of n elements. Find three numbers from the array that will add up to a given number k. My approach: Use two pointers that point to first ... nlogn) I can't figure out when to increment L or when to decrement H, in case z is not found. Any ideas? Thank you
Can somebody help me out to figure out an algorithm that would work in O(nlogn) for the following problem?Given a SORTED array of n elements. Find three numbers from the ...
Prince07
412
views
Prince07
asked
May 5, 2017
Algorithms
algorithm-design
sorting
+
–
4
votes
1
answer
316
Selection sort and Insertion sort
Selection sort is an example of ____(I)_______ and insertion sort is an example of __(II)______. a) I- Greedy, II- Brute Force b) I- Brute Force II- Divide and conquer c) I- Greedy II- Divide and conquer d) I- Brute Force II- Brute Force
Selection sort is an example of ____(I)_______ and insertion sort is an example of __(II)______.a) I- Greedy, II- Brute Forceb) I- Brute Force II- Divide and conquerc) I-...
sh!va
1.8k
views
sh!va
asked
Apr 27, 2017
Algorithms
sorting
algorithms
+
–
0
votes
1
answer
317
Complexity
We have for Counting Sort, O(n+k), for a simple uniform hashing, search operation of O(1+alpha) etc. What is the meaning when we say n + k? Is it that counting sort will depend on either n or k? Because there are separate loops in counting sort running on O(n) and O(k) separately. What does O(n + k) mean? What kind of algorithms have this summation for their order, generally?
We have for Counting Sort, O(n+k), for a simple uniform hashing, search operation of O(1+alpha) etc. What is the meaning when we say n + k? Is it that counting sort will ...
Ciado
525
views
Ciado
asked
Apr 27, 2017
Algorithms
algorithms
time-complexity
asymptotic-notation
sorting
+
–
0
votes
2
answers
318
Sorting
Which sorting algorithim is best if exhactly only half of the elements are in correct position ?
Which sorting algorithim is best ifexhactly only half of the elements are in correct position ?
Angkit
1.3k
views
Angkit
asked
Apr 23, 2017
Others
sorting
algorithms
+
–
1
votes
3
answers
319
Which sorting algorithm can be used to sort a random linked list with minimum time complexity ?
Which sorting algorithm can be used to sort a random linked list with minimum time complexity ? A)mergesort B)quicksort C)radixsort D)insertionsort E)heapsort
Which sorting algorithm can be used to sort a random linked list with minimum time complexity ?A)mergesortB)quicksortC)radixsortD)insertionsortE)heapsort
Angkit
14.6k
views
Angkit
asked
Apr 23, 2017
Algorithms
sorting
algorithms
+
–
2
votes
3
answers
320
With quick sort The results after first partioning of the given array
With quick sort The results after first partioning of the given array. A = (2,8,7,1,3,5,6,4,9). Analysis the time complexity of Quick sort in the best case.
With quick sort The results after first partioning of the given array. A = (2,8,7,1,3,5,6,4,9).Analysis the time complexity of Quick sort in the best case.
LavTheRawkstar
1.2k
views
LavTheRawkstar
asked
Apr 15, 2017
Algorithms
algorithms
quick-sort
time-complexity
sorting
+
–
6
votes
1
answer
321
geeksforgeeks
Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array now looks like this: 16 14 15 10 12 27 28 How many heapify operations have been performed on root of heap? (A) 1 (B) 2 (C) 3 or 4 (D) 5 or 6 Answer: (B)
Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array now looks...
shraddha_gami
9.1k
views
shraddha_gami
asked
Apr 13, 2017
Algorithms
sorting
binary-heap
heap-sort
+
–
0
votes
1
answer
322
cormen
why does radix sort uses stable sort i.e counting sort as an intermediate sorting algorithm?
why does radix sort uses stable sort i.e counting sort as an intermediate sorting algorithm?
shebya nautiyal
438
views
shebya nautiyal
asked
Apr 7, 2017
Algorithms
sorting
radix-sort
cormen
+
–
0
votes
2
answers
323
cormen
counting sort assumes that each of the n input is an integer in the range 0 to k, for some integer k. please explain when k=O(n), the sort run in O(n) time.
counting sort assumes that each of the n input is an integer in the range 0 to k, for some integer k.please explain when k=O(n), the sort run in O(n) time.
shebya nautiyal
433
views
shebya nautiyal
asked
Apr 7, 2017
Algorithms
cormen
sorting
time-complexity
+
–
1
votes
1
answer
324
complexity
Let there are n elements in array and number of sorted subarray is log n of size n/ log n each then what is the time complexity to sort given array
Let there are n elements in array and number of sorted subarray is log n of size n/ log n each thenwhat is the time complexity to sort given array
Meenakshi Sharma
442
views
Meenakshi Sharma
asked
Mar 25, 2017
Algorithms
sorting
time-complexity
+
–
0
votes
1
answer
325
Ace Test Series: Algorithms - Sorting
The tightest lower bound on the number of comparisons, in worst case for comparison based sorting is of the order of ? (A)$n$ (B)$n^2$ (C)$nlogn$ (D)$n \space{log\space n}^2$
The tightest lower bound on the number of comparisons, in worst case for comparison based sorting is of the order of ?(A)$n$(B)$n^2$(C)$nlogn$(D)$n \space{log\space n}^2$...
Ayush Upadhyaya
631
views
Ayush Upadhyaya
asked
Mar 8, 2017
Algorithms
ace-test-series
algorithms
sorting
+
–
1
votes
1
answer
326
algorithm, Sorting
which sorting algorihm is used if we have a telephone directory wit 1,00,000 entries ?
which sorting algorihm is used if we have a telephone directory wit 1,00,000 entries ?
moin
984
views
moin
asked
Mar 7, 2017
Algorithms
algorithms
normal
sorting
+
–
1
votes
1
answer
327
bubble sort
A machine takes 200 second to sort 200 names, using bubble sort . In 800 seconds , it can approximately sort how many names?
A machine takes 200 second to sort 200 names, using bubble sort . In 800 seconds , it can approximately sort how many names?
PriDix
1.7k
views
PriDix
asked
Feb 26, 2017
Algorithms
sorting
time-complexity
algorithms
+
–
0
votes
2
answers
328
best case complexity
Which of the following sorting algorithms has/have minimum running time complexity in best case? I. Selection Sort II. Insertion Sort a. I b. II c. Both have same minimum running time complexity
Which of the following sorting algorithms has/have minimum running time complexity in best case?I. Selection SortII. Insertion Sorta. Ib. IIc. Both have same minimum runn...
sh!va
3.7k
views
sh!va
asked
Feb 15, 2017
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
3
answers
329
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
446
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
algorithms
divide-and-conquer
sorting
quick-sort
+
–
1
votes
1
answer
330
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
209
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
algorithms
sorting
+
–
Page:
« prev
1
...
6
7
8
9
10
11
12
13
14
15
16
...
19
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register