Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sorting
1
votes
1
answer
181
# Heap sort
Sort The Following Sequence of input using Heap sort. { 10 , 2 , 1 , 5, 3 ,8 ,11,24 ,7 } Please show the output at every pass because i am getting confused.
Sort The Following Sequence of input using Heap sort.{ 10 , 2 , 1 , 5, 3 ,8 ,11,24 ,7 }Please show the output at every pass because i am getting confused.
LavTheRawkstar
1.1k
views
LavTheRawkstar
asked
Sep 9, 2018
Algorithms
algorithms
binary-heap
heap-sort
sorting
+
–
0
votes
0
answers
182
what is correct answer algo
https://gateoverflow.in/20617/tifr2011-b-31 1+2(n-2) is correct ???i.e option d looks more correct....??
https://gateoverflow.in/20617/tifr2011-b-311+2(n-2) is correct ???i.e option d looks more correct....??
eyeamgj
334
views
eyeamgj
asked
Sep 2, 2018
Algorithms
algorithms
sorting
+
–
0
votes
0
answers
183
can we apply insertion sort also ??
https://gateoverflow.in/688/gate2000-17 there is swap between adjacent element in insertion sort also??
https://gateoverflow.in/688/gate2000-17there is swap between adjacent element in insertion sort also??
eyeamgj
324
views
eyeamgj
asked
Sep 2, 2018
Algorithms
sorting
+
–
0
votes
0
answers
184
SELF DOUBT
https://gateoverflow.in/840/gate2002-2-10 SUPPODE IN THIS QUESTION I TAKE A EXAMPLE LIKE UNSORTED ARRAY 3 1 2 4 INDEX 0 1 2 3 and we need to find element x=4 NOW SUPPOSE I AM APPLY ABOVE ALGO let i=2 checking A[i] with x not matched so go ... be different in each iteration ...and scond doubt is that at each iteration the number of comparision is only one so how expected comparision is n
https://gateoverflow.in/840/gate2002-2-10SUPPODE IN THIS QUESTION I TAKE A EXAMPLE LIKE UNSORTED ARRAY 3 1 2 4INDEX 0 1 2 3 ...
eyeamgj
291
views
eyeamgj
asked
Sep 1, 2018
Algorithms
sorting
+
–
0
votes
1
answer
185
algorithm self doubt
suppose we are given a sorted array ....and we need to extract minimum every tym what is the time complexity?? and what is the tym complexity to delete the minimum ? are they both same ?? and what is the tym complexity to delete an element?
suppose we are given a sorted array ....and we need to extract minimum every tym what is the time complexity??and what is the tym complexity to delete the minimum ? are ...
eyeamgj
488
views
eyeamgj
asked
Aug 25, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
4
votes
1
answer
186
Gateforum Test Series: Algorithms - Sorting
. 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)nlogn
. 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)nlogn
Prince Sindhiya
2.0k
views
Prince Sindhiya
asked
Aug 23, 2018
Algorithms
gateforum-test-series
algorithms
sorting
merge-sort
+
–
0
votes
0
answers
187
Gateforum Test Series: Algorithms - Sorting
i mark the option D) but answer is A)
i mark the option D) but answer is A)
Prince Sindhiya
525
views
Prince Sindhiya
asked
Aug 23, 2018
Algorithms
gateforum-test-series
algorithms
sorting
time-complexity
+
–
0
votes
0
answers
188
GeeksforGeeks Doubt
Which of the following is not true about comparison based sorting algorithms? (A) The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) for a random input array (B) Any comparison based sorting algorithm can be made ... (C) Counting Sort is not a comparison based sorting algortihm (D) Heap Sort is not a comparison based sorting algorithm.
Which of the following is not true about comparison based sorting algorithms?(A) The minimum possible time complexity of a comparison based sorting algorithm is O(nLogn) ...
Sumit Singh Chauhan
3.1k
views
Sumit Singh Chauhan
asked
Aug 18, 2018
Algorithms
algorithms
sorting
comparison-based-sorting
+
–
0
votes
0
answers
189
Heap Sorting
Consider a binary tree, where left and right subtreealready heapified. But we havenot done heapificationfor root yet. Then what is time complexity to convert it in a full heap tree? $A)O(\log n)$ or $o(n)$ $B)\Omega (\log n)$ or $\omega(n)$ $C)\Theta (\log n)$ or $\theta (n)$ $D)\text{None of these}$
Consider a binary tree, where left and right subtreealready heapified. But we havenot done heapificationfor root yet. Then what is time complexity to convert it in a full...
srestha
1.6k
views
srestha
asked
Aug 18, 2018
DS
algorithms
sorting
binary-heap
time-complexity
+
–
0
votes
0
answers
190
Merge Sort (Code)
why this margeSort program showing time limit exceed ? #include <stdio.h> #include <stdlib.h> #include <time.h> void fillArray(int array[], int n) { time_t t; time(&t);//get current time srand(t);//gives current time as seed ... CLOCKS_PER_SEC; printArray(Array, n); printf("\n \n Time taken for sorting: %f seconds\n\n",cpu_time_used); return 0; }
why this margeSort program showing time limit exceed ?#include <stdio.h #include <stdlib.h #include <time.h void fillArray(int array[], int n) { time_t t; time(&t);//get ...
srestha
587
views
srestha
asked
Aug 18, 2018
Programming in C
merge-sort
algorithms
sorting
+
–
1
votes
1
answer
191
Time Complexity
Given two sorted arrays A and B containing distinct elements Array length given as m and n , What is the time complexity to find the Intersection My query is since the length of array is given and both array contain distinct elements ( their can be common elements bw A and B). So it should be O(m) if m<n else O(n) instead of O(m+n).
Given two sorted arrays A and B containing distinct elements Array length given as m and n , What is the time complexity to find the IntersectionMy query is since the le...
Shiv Gaur
618
views
Shiv Gaur
asked
Aug 17, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
2
answers
192
self doubt
Best and Worst case input for: 1. Selection Sort 2. Insertion Sort 3. Merge Sort 4. Quick Sort 5. Bucket Sort 6. Counting Sort 7. Bubble Sort
Best and Worst case input for:1. Selection Sort2. Insertion Sort3. Merge Sort4. Quick Sort5. Bucket Sort6. Counting Sort7. Bubble Sort
iamdeepakji
257
views
iamdeepakji
asked
Aug 17, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
1
answer
193
Binary search
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is (A) (n) (B) (logn) (C) (log*n) (D) (1)
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is(A) (n)(B) (logn)(C) (log*n)(D) (1)
Sabir Khan
1.1k
views
Sabir Khan
asked
Aug 8, 2018
Algorithms
algorithms
sorting
binary-search
time-complexity
+
–
0
votes
1
answer
194
Ace Algorithms
If given numbers are 12,7,15,8,19,20,17,21,5,3 in _______ passes of quick sort element 5 will be in sorted position. (Considering last element as pivot)
If given numbers are 12,7,15,8,19,20,17,21,5,3 in _______ passes of quick sort element 5 will be in sorted position. (Considering last element as pivot)
Sambhrant Maurya
542
views
Sambhrant Maurya
asked
Aug 7, 2018
Algorithms
sorting
quick-sort
+
–
0
votes
1
answer
195
self doubt
worst no. of comparision required for sort n numbers by insertion sort and selection sort if: 1. Array is already sorted. 2. Array is sorted but in descending order. 3. Array is not sorted.
worst no. of comparision required for sort n numbers by insertion sort and selection sort if:1. Array is already sorted.2. Array is sorted but in descending order.3. Arra...
iamdeepakji
336
views
iamdeepakji
asked
Aug 5, 2018
Algorithms
algorithms
sorting
+
–
0
votes
0
answers
196
Sorting
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 aspivot. Let t1 and t2 be the number of comparisons made by P for the inputs {1, 2...
Solarica Palit
534
views
Solarica Palit
asked
Aug 2, 2018
Algorithms
sorting
+
–
1
votes
2
answers
197
Sorting
Could a binary search tree be built using o(n lg n) comparisons in the comparison model? Explain why or why not.
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.
Ravi Dubey
855
views
Ravi Dubey
asked
Aug 2, 2018
Algorithms
sorting
algorithms
time-complexity
test-series
+
–
1
votes
2
answers
198
ACE volume 2 divide and conquer
given an array that contain only two value (0 or 1) and an insertion sort is used to sort that array, which of the following input require maximum number of comparisons ? a)111111000000 b)101010101010 c)000000111111 c)010101010101 here, ans is ... compare to each element and the move that element to specified position. then how option (a) is correct plz explain me.
given an array that contain only two value (0 or 1) and an insertion sort is used to sort that array,which of the following input require maximum number of comparisons ?a...
meethunjadhav
985
views
meethunjadhav
asked
Jul 30, 2018
Algorithms
sorting
divide-and-conquer
+
–
1
votes
1
answer
199
Ace volume-2 divide and conquer method
suppose merge sort takes 2 sec to sort a set of 64 keys then how much time will take to sort a set of 512 keys? here, ans is 24 sec how it is plz explain me.
suppose merge sort takes 2 sec to sort a set of 64 keys then how much time will take to sort a set of 512 keys?here, ans is 24 sec how it is plz explain me.
meethunjadhav
434
views
meethunjadhav
asked
Jul 30, 2018
Algorithms
time-complexity
merge-sort
sorting
divide-and-conquer
+
–
1
votes
1
answer
200
Massachusetts Institute of Technology Professors Ron Rivest and Srini Devadas
There exists a comparison sort of 5 numbers that uses at most 6 comparisons in the worst case. True or False and Why?
There exists a comparison sort of 5 numbers that uses at most 6 comparisons in the worst case.True or False and Why?
Rishav Kumar Singh
288
views
Rishav Kumar Singh
asked
Jul 29, 2018
Algorithms
algorithms
sorting
true-false
+
–
2
votes
3
answers
201
sorting
When the recurrence relation for both are same , why they both getting different result? Q1. 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? ANSWER: recurrence ... is If for first case it is N(log3/2N) then for second case also it should be N(log4/3N) BUT its not. WHY?
When the recurrence relation for both are same , why they both getting different result?Q1. In a modified merge sort, the input array is splitted at a position one-third ...
Rishav Kumar Singh
1.4k
views
Rishav Kumar Singh
asked
Jul 29, 2018
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
1
answer
202
algorithm corman
Insertion sort uses an incremental approach for designing algorithm can someone please explain?
Insertion sort uses an incremental approach for designing algorithm can someone please explain?
saurabh12345
422
views
saurabh12345
asked
Jul 24, 2018
Algorithms
sorting
cormen
algorithm-design
+
–
0
votes
1
answer
203
sorting
Given 2-sorted arrays each of n-elements and distinct. How much time it will take to find middle element of the union sorted array? a) O(1) b) O(logn) c) O(n) d) None of these explain briefly.
Given 2-sorted arrays each of n-elements and distinct. How much time it will take to find middle element of the union sorted array?a) O(1)b) O(logn)c) O(n)d) None of thes...
Siddharth Bhardawaj
1.6k
views
Siddharth Bhardawaj
asked
Jul 21, 2018
Algorithms
time-complexity
sorting
+
–
0
votes
2
answers
204
sorting
The maximum number of swap possible of an unsorted array[1....n] in quicksort is? a) O(n) b) O($n^{2}$) Explain briefly.
The maximum number of swap possible of an unsorted array[1....n] in quicksort is?a) O(n)b) O($n^{2}$)Explain briefly.
Siddharth Bhardawaj
1.7k
views
Siddharth Bhardawaj
asked
Jul 19, 2018
Algorithms
sorting
quick-sort
+
–
0
votes
2
answers
205
Time complexity
Given two sorted arrays each of n elements and distinct .how much time it will take to find the middle element of the union sorted array ? 1.O(1) 2.O(logn) 3.O(n) 4.none of these .
Given two sorted arrays each of n elements and distinct .how much time it will take to find the middle element of the union sorted array ?1.O(1)2.O(logn)3.O(n)4.none of t...
Tripti bhardwaj
407
views
Tripti bhardwaj
asked
Jul 18, 2018
Algorithms
sorting
time-complexity
+
–
0
votes
2
answers
206
Self doubt
The total number of comparions required to merge 4 sorted files containing 15, 3, 9 and 8 records into a single sorted file is A. 66 B. 39 C. 15 D. 33
The total number of comparions required to merge 4 sorted files containing 15, 3, 9 and 8 records into a single sorted file is A.66 B.39 C.15 D.33
Raj Kumar 7
1.6k
views
Raj Kumar 7
asked
Jul 17, 2018
Algorithms
algorithms
merging
sorting
+
–
1
votes
1
answer
207
Self doubt
When sorting technique is called stable?
When sorting technique is called stable?
imnitish
878
views
imnitish
asked
Jul 9, 2018
Algorithms
algorithms
sorting
+
–
4
votes
7
answers
208
Searching
Q) Consider a sorted array of n numbers. What would be the time complexity of the best known algorithm to find a pair a and b such that |a-b| = k , k being a positive integer. a) O(logn) b) O(n) c)O(nlogn) d)O(n^2) Which of the option is Correct And Why?
Q) Consider a sorted array of n numbers. What would be the time complexity of the best known algorithm to find a pair a and b such that |a-b| = k , k being a positive int...
pradeepchaudhary
12.7k
views
pradeepchaudhary
asked
Jul 9, 2018
Algorithms
algorithms
sorting
time-complexity
binary-search
+
–
0
votes
3
answers
209
Merge Sort
A list of n string, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is (A) (B) (C) (D)
A list of n string, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is(A) (B) (C) (D)...
pradeepchaudhary
1.5k
views
pradeepchaudhary
asked
Jul 8, 2018
Algorithms
merge-sort
algorithms
sorting
merging
+
–
0
votes
1
answer
210
Sorting:
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate? 1)QuickSort 2)MergeSort 3)HeapSort 4)Selection Sort Explain? How
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?1)QuickSort2)MergeSort3)HeapSort4)Selection Sort...
pradeepchaudhary
3.3k
views
pradeepchaudhary
asked
Jul 8, 2018
Algorithms
sorting
algorithms
time-complexity
heap-sort
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
11
12
...
19
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register