Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sorting
5
votes
1
answer
271
In-place Merge Sort via Doubly linked list in place of Array
In general merge sort is not considered in-place sorting technique. Because an auxiliary array is used. If we will try to do it in-place in array data structure then our merge procedure will take O($n^2$) time. so overall ... list in place of Array (for storing and merging data) ? Please share your valuable opinion. It will be great help.
In general merge sort is not considered in-place sorting technique. Because an auxiliary array is used. If we will try to do it in-place in array data structure then our ...
Chhotu
1.4k
views
Chhotu
asked
Nov 2, 2017
Algorithms
algorithms
sorting
space-complexity
linked-list
time-complexity
+
–
2
votes
1
answer
272
algorithm
Suppose A is sorted array and some of the elements are duplicates what is the best upper bound to find out the number of elements that are equal to any given key 'k'.
Suppose A is sorted array and some of the elements are duplicates what is the best upper bound to find out the number of elements that are equal to any given key 'k'.
Kaluti
866
views
Kaluti
asked
Nov 1, 2017
Algorithms
algorithms
sorting
+
–
2
votes
0
answers
273
Sorting
If we are asked to find best comparison based sorting algorithm to sort n numbers having d digit's and in the range from [1-k]. If I say it is quick sort or merge sort or heap sort is it wrong ? OR in general we do sorting on these type of numbers using Radix sort only ?
If we are asked to find best comparison based sorting algorithm to sort n numbers having d digit's and in the range from [1-k].If I say it is quick sort or merge sort or ...
junaid ahmad
654
views
junaid ahmad
asked
Oct 29, 2017
Algorithms
sorting
+
–
0
votes
0
answers
274
MERGE SORT
IS 2 way merge sort and normal merge sort is same.in which we have to use bottom-up merging approach by taking 2-2 element inside the list.if 5-way merge sort then in the list we have to take 5-5 elements from bottom to up for merging. if I am wrong please let me correct!
IS 2 way merge sort and normal merge sort is same.in which we have to use bottom-up merging approach by taking 2-2 element inside the list.if 5-way merge sort then in the...
learner_geek
601
views
learner_geek
asked
Oct 28, 2017
Algorithms
merge-sort
algorithms
sorting
time-complexity
+
–
0
votes
1
answer
275
Algorithm doubt
In sorted array of size n time required to verify if there exist 2 number a and b such that a+ b = s in worst case Where s is a constant.
In sorted array of size n time required to verify if there exist 2 number a and b such that a+ b = s in worst case Where s is a constant.
Surya Dhanraj
419
views
Surya Dhanraj
asked
Oct 24, 2017
Algorithms
sorting
time-complexity
+
–
4
votes
1
answer
276
Modified form of GATE1996_2.15
Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivot i) 1,2,3,…n ii) n,n−1,n−2,…,2,1 Let S1 and S2 be the number of swaps made for the inputs (i) and (ii) respectively. Then, i) How is S1 and S2 related ? ii) How will the answer change if the pivot is changed to middle element ?
Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivoti) 1,2,3,…nii) n,n−1,n−2,…,2,1Let S1 and S2 be the number of s...
rishi71662data4
963
views
rishi71662data4
asked
Oct 18, 2017
Algorithms
algorithms
data-structures
sorting
quick-sort
+
–
3
votes
2
answers
277
Time complexity
Given a 2D array X[m][n] which has m rows and n columns. The array X is row wise and column wise sorted (i.e) each individula row and column is sorted. What is the complexity to search an element in this array a)O(m*n) b)O(m2) or O(n2) c)O(log2(m*n)) d)O(m+n)
Given a 2D array X[m][n] which has m rows and n columns. The array X is row wise and column wise sorted (i.e) each individula row and column is sorted. What is the comple...
A_i_$_h
847
views
A_i_$_h
asked
Oct 12, 2017
Algorithms
sorting
time-complexity
+
–
4
votes
1
answer
278
Merge sort
True or False Merge sort on Linked list takes O(nlogn)
True or FalseMerge sort on Linked list takes O(nlogn)
Shivi rao
1.5k
views
Shivi rao
asked
Oct 10, 2017
DS
merge-sort
algorithms
sorting
time-complexity
+
–
2
votes
1
answer
279
Test series
An array ‘A’ of length n contains numbers {0, 1, 2}, numbers are present in array in arbitrary order. The best sorting algorithms, takes 250 units of time when n = 100. If n = 450. The minimum time required by algorithm on same hardware __________ (Rounded off to integers).
An array ‘A’ of length n contains numbers {0, 1, 2}, numbers are present in array in arbitrary order.The best sorting algorithms, takes 250 units of time when n = 100...
Shivi rao
484
views
Shivi rao
asked
Oct 9, 2017
Algorithms
test-series
algorithms
sorting
time-complexity
+
–
4
votes
4
answers
280
Ace Test Series: Algorithms - Sorting
Consider bottom-up merge sort working on 'n' elements. Assume 'n' is a power of 2. The minimum number of comparisons in order to get sorted list is (A) (n log n) / 2 (B) n lon n - n + 1 (C) n log n (D) n log n + n
Consider bottom-up merge sort working on 'n' elements. Assume 'n' is a power of 2. The minimum number of comparisons in order to get sorted list is(A) (n log n) / 2(B) n ...
Aibi
2.6k
views
Aibi
asked
Oct 8, 2017
Algorithms
merge-sort
ace-test-series
sorting
algorithms
+
–
1
votes
1
answer
281
made easy test
charul
428
views
charul
asked
Oct 2, 2017
Algorithms
made-easy-test-series
sorting
+
–
1
votes
1
answer
282
QUICKSORT
Could anyone describe how the partitioning algorithm vary when the pivot is varied ? In Cormen , last element is taken as pivot . Suppose I took first element or middle element or 3 rd element as pivot then how the partitioning algorithm will change.
Could anyone describe how the partitioning algorithm vary when the pivot is varied ?In Cormen , last element is taken as pivot . Suppose I took first element or middle e...
dragonball
615
views
dragonball
asked
Sep 27, 2017
Algorithms
algorithms
sorting
quick-sort
+
–
2
votes
2
answers
283
Algorithm: Selection Sort
Consider the following code which sort all elements of an array A' in descending order. Which of the following will represents correct value of X, Y, Z in above code for selection sort? a. i > 0, K > 0, a[K] > a[max] b. i ... the array in the descending order but by using option a it is aranging in ascending order. And option D is doing what question is saying.
Consider the following code which sort all elements of an array ‘A’ in descending order.Which of the following will represents correct value of X, Y, Z in above code ...
Shubhanshu
1.8k
views
Shubhanshu
asked
Sep 24, 2017
Algorithms
algorithms
sorting
selection-sort
test-series
+
–
1
votes
2
answers
284
Bucket sort
1. Is bucket sort always stable or does it depend on the sorting subroutine used by bucket sort toe sort the buckets? 2. Bucket sort is always NOT inplace.Is this correct?
1. Is bucket sort always stable or does it depend on the sorting subroutine used by bucket sort toe sort the buckets?2. Bucket sort is always NOT inplace.Is this correct...
rahul sharma 5
873
views
rahul sharma 5
asked
Sep 22, 2017
Algorithms
sorting
algorithms
+
–
1
votes
1
answer
285
arrange the sorting algorithms ascending wise
What is the ascending wise order of sorting algorithms which takes least time and least space to sort the elements?
What is the ascending wise order of sorting algorithms which takes least time and least space to sort the elements?
LavTheRawkstar
2.4k
views
LavTheRawkstar
asked
Sep 11, 2017
Programming in C
algorithms
programming-in-c
time-complexity
sorting
+
–
3
votes
3
answers
286
Quick Sort
"Quick sort has good cache performance" , Can anyone explain this statement.How is cache related to quick sort.I searched for this over the internet but could not find a good article.
"Quick sort has good cache performance" , Can anyone explain this statement.How is cache related to quick sort.I searched for this over the internet but could not find a ...
Sourajit25
1.6k
views
Sourajit25
asked
Sep 3, 2017
Algorithms
algorithms
sorting
time-complexity
quick-sort
+
–
1
votes
1
answer
287
Divide and Conquer
Given an unsorted array. The array has this property that every element in array is at most k distance from its position in sorted array where k is a positive integer smaller than size of array. Which sorting algo can be easily modified for sorting this array and what is the obtainable time complexity ?
Given an unsorted array. The array has this property that every element in array is at most k distance from its position in sorted array where k is a positive integer sma...
chetan raghav
642
views
chetan raghav
asked
Sep 3, 2017
Algorithms
divide-and-conquer
sorting
time-complexity
+
–
3
votes
3
answers
288
Sorted List
suppose there are 4 sorted lists of n/4 elements each. if we merge these list into a single sorted list of n elements, for the n=400 number of key comparisons in the worst case using an efficient algorithm is
suppose there are 4 sorted lists of n/4 elements each. if we merge these list into a single sorted list of n elements, for the n=400 number of key comparisons in the wors...
ABKUNDAN
5.7k
views
ABKUNDAN
asked
Aug 21, 2017
Algorithms
sorting
algorithms
+
–
1
votes
1
answer
289
Please solve this Q
What could be the best algorithm from the following when the time complexity is measured based bon the number of swaps performed by the sorting algorithm? 1. Selection sort 2. Insertion sort 3. Bubble sort 4. None of these
What could be the best algorithm from the following when the time complexity is measured based bon the number of swaps performed by the sorting algorithm?1. Selection sor...
kallu singh
242
views
kallu singh
asked
Aug 19, 2017
Algorithms
time-complexity
sorting
+
–
3
votes
1
answer
290
Quick sort
When array is already sorted in reverse order then what will be the recurrence relation for number of swaps on array of n elements using quick sort?
When array is already sorted in reverse order then what will be the recurrence relation for number of swaps on array of n elements using quick sort?
SHALINI PORWAL
1.4k
views
SHALINI PORWAL
asked
Aug 10, 2017
Algorithms
algorithms
sorting
time-complexity
quick-sort
+
–
2
votes
2
answers
291
merge sort no. of levels when input is n ??
HOW NO. OF LEVELS IS LOG N + 1 CAN ANYONE HELP ME , how to solve this and get log n + 1
HOW NO. OF LEVELS IS LOG N + 1 CAN ANYONE HELP ME , how to solve this and get log n + 1
sumit goyal 1
725
views
sumit goyal 1
asked
Aug 9, 2017
Algorithms
algorithms
sorting
merge-sort
+
–
4
votes
0
answers
292
Sorting: A comparison between sorting Algos
When an array is to be sorted, It may happen that some data values start out being in the same position where they should end up. For example in the array which is originally {40, -1, 33, 0} 33 is right where it will be in the final sorted output: {- ... (even temporarily) moves such an element (a) ii only (b) i & iii (c) i & ii (d) ii & iii
When an array is to be sorted, It may happen that some data values start out being in the same position where they should end up. For example in the array which is origin...
Manu Thakur
758
views
Manu Thakur
asked
Jul 31, 2017
Algorithms
algorithms
sorting
+
–
1
votes
1
answer
293
algorithm
array has n elements and we need to sort them in non decreasing order as follows. first find minimum, remove this element from the array and find minimum of remaining elements, remove this element and so on until array becomes emplty . In best case how many comparisons needed
array has n elements and we need to sort them in non decreasing order as follows. first find minimum, remove this element from the array and find minimum of remaining ele...
A_i_$_h
287
views
A_i_$_h
asked
Jul 24, 2017
Algorithms
sorting
array
time-complexity
+
–
1
votes
1
answer
294
algorithm
Array of 1 to n^6 , which algorithm can be used to sort in linear time? a) not possible B)radix c)counting d)quick
Array of 1 to n^6 , which algorithm can be used to sort in linear time?a) not possibleB)radixc)countingd)quick
A_i_$_h
324
views
A_i_$_h
asked
Jul 22, 2017
Algorithms
sorting
time-complexity
+
–
1
votes
0
answers
295
number of movements in Insertion sort
will A[i+1]=key; in the insertion sort be counted as a movement in best case?
will A[i+1]=key; in the insertion sort be counted as a movement in best case?
vineet.ildm
1.0k
views
vineet.ildm
asked
Jul 18, 2017
Algorithms
algorithms
sorting
+
–
1
votes
1
answer
296
Daa........
What is the ans and give reason
What is the ans and give reason
Dharam raj
705
views
Dharam raj
asked
Jul 12, 2017
Algorithms
sorting
algorithm-design-technique
test-series
+
–
1
votes
1
answer
297
Complexity
What is the method to find the time complexity to search an element which appears more than 20% in sorted array having n elements. and also for 1% or 40% .
What is the method to find the time complexity to search an element which appears more than 20% in sorted array having n elements.and also for 1% or 40% .
Diksha Aswal
343
views
Diksha Aswal
asked
Jul 11, 2017
Algorithms
time-complexity
sorting
+
–
2
votes
1
answer
298
Gate algorithm
Harikesh Kumar
502
views
Harikesh Kumar
asked
Jul 10, 2017
Algorithms
sorting
binary-search
time-complexity
test-series
+
–
2
votes
1
answer
299
Insertion Sort
How to get Time Complexity of finding the number of inversions in an array?
How to get Time Complexity of finding the number of inversions in an array?
Diksha Aswal
378
views
Diksha Aswal
asked
Jul 8, 2017
Algorithms
sorting
time-complexity
+
–
2
votes
1
answer
300
Introduction To Algorithms 8.3-2
How are heap sort and quick sort not stable?
How are heap sort and quick sort not stable?
Shubham Pande
521
views
Shubham Pande
asked
Jul 7, 2017
Algorithms
algorithms
sorting
+
–
Page:
« prev
1
...
5
6
7
8
9
10
11
12
13
14
15
...
19
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register