The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
Facebook Login
Google Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged sorting
0
votes
1
answer
1
GATE200322 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 identify the ... case will be O(nlogn) because here no matter what the binary search will be performed for every element. Can someone confirm?
asked
Dec 3
in
Algorithms
by
Mk Utkarsh
Boss
(
28.7k
points)

51
views
algorithms
sorting
0
votes
0
answers
2
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.
asked
Dec 1
in
Algorithms
by
Shubhanshu
Boss
(
16.7k
points)

25
views
algorithms
sorting
quicksort
mergesort
0
votes
1
answer
3
Kth Largest element in MinHeap
What is the time complexity to find the Kth largest element in a MinHeap? Or equivalently, What is the time complexity to find Kth smallest element in MaxHeap?
asked
Dec 1
in
Algorithms
by
gmrishikumar
(
451
points)

48
views
algorithms
heap
binaryheap
timecomplexity
sorting
0
votes
0
answers
4
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/gate2014314 https://gateoverflow.in/1830/gate200652 https://gateoverflow.in/25209/tifr2012b14
asked
Nov 30
in
Algorithms
by
Gupta731
Active
(
2.5k
points)

34
views
algorithms
sorting
0
votes
0
answers
5
Max heap when stored in an array is always in sorted order
asked
Nov 15
in
DS
by
sripo
Junior
(
885
points)

77
views
sorting
binaryheap
arrays
heap
datastructure
algorithms
0
votes
0
answers
6
hoare and loranto quicksort
between hoare and loranto quicksort which give better cache performance ? we know that in hoare quicksort we move the pointer i,j in different direction but in loranto quicksort we move i,j in same direction so the cache performance of loranto should be better?
asked
Nov 13
in
Algorithms
by
Gurdeep Saini
Active
(
5k
points)

27
views
algorithms
sortingalgorithmsquicksort
sorting
quicksort
0
votes
0
answers
7
Self doubt on sorting
$(1)$Give $"logn"$ Sorted lists each of size $"\frac{n}{logn}",$what is the total time required to merge them into one single list? $(2)"n"$ strings each of length $"n"$ are given them, what is the time ... $O(n)$ time algorithm.What is the worst case time complexity of quicksort?
asked
Nov 1
in
Algorithms
by
Lakshman Patel RJIT
Boss
(
17.8k
points)

75
views
algorithms
sorting
0
votes
0
answers
8
Self doubt on sorting algorithm
What is the average case time complexity of the best sorting algorithm for an array having 2^n^2 elements . I know that the best sorting algorithm is no better than O(n log n).Please answer in terms of the asymptotic notation.
asked
Oct 27
in
Algorithms
by
argha1992
(
19
points)

24
views
sorting
algorithms
discretemathematics
0
votes
0
answers
9
TANCET 2011 SORTING
An array has 5 elements. Calculate the following: SL. NO: NAME ARRAY IS ALREADY SORTED ARRAY IS REVERSE SORTED ELEMENT COMPARSIONS ELEMENT EXCHANGES ELEMENT COMPARISONS ELEMENT EXCHANGES 1 BUBBLE SORT ? ? ? ? 2 SELECTION SORT ? ? ? ? 3 INSERTION SORT ? ? ? ? 4 QUICK SORT ? ? ? ? 5 MERGE ... ? ? 6 RADIX SORT ? ? ? ? 7 HEAP SORT ? ? ? ? 8 TREE SORT ? ? ? ? 9 COUNTING SORT ? ? ? ?
asked
Oct 24
in
Algorithms
by
Balaji Jegan
Active
(
3.9k
points)

55
views
tancet
sorting
algorithms
0
votes
0
answers
10
sorting
just tell me about the quick sort
asked
Oct 21
in
Algorithms
by
Prince Sindhiya
Active
(
5.2k
points)

98
views
sorting
algorithms
0
votes
1
answer
11
Insertion Sort
Consider following Statements : S1 : On any random input insertion Sort works more efficiently then Bubble Sort. S2 : Average number of Comparison of Insertion Sort is better then bubble sort by a constant Factor. If efficiency is considered as number of comparisons to sort an Input Array Which of Following is Correct ? A. Only S1 B. Only S2 C. Both S1 and S2 D. None
asked
Oct 20
in
Algorithms
by
Na462
Loyal
(
7.4k
points)

53
views
algorithms
sorting
0
votes
3
answers
12
Find total number of comparisons needed
What is the total number of comparisons needed in the best case to find minimum and maximum of $300 $ elements?
asked
Oct 10
in
Algorithms
by
pankaj_vir
Loyal
(
9.7k
points)

105
views
algorithms
normal
sorting
+1
vote
0
answers
13
radix sort counting sort
Given an array where numbers are in range from 1 to n6, which sorting algorithm can be used to sort these number in linear time? 1)Counting Sort 2)Radix Sort 3)Bubble Sort 4)Merge Sort.
asked
Oct 9
in
Algorithms
by
Kaushal Sanadhya
(
63
points)

58
views
algorithms
sorting
timecomplexity
radix
+1
vote
0
answers
14
Merge sort
How many swaps are performed in Merge sort algorithm in worst case?
asked
Oct 9
in
Algorithms
by
Kaushal Sanadhya
(
63
points)

113
views
mergesort
algorithms
sorting
merging
0
votes
0
answers
15
Merge Sort Doubt
what is the recurrence relation for merge sort?
asked
Oct 6
in
Algorithms
by
aditi19
Active
(
2k
points)

54
views
mergesort
algorithms
timecomplexity
#recurrencerelations
sorting
divideandconquer
0
votes
0
answers
16
Quick Sort Analysis
Consider the Quicksort algorithm.Suppose there is a procedure for finding a pivot element which splits the list into two sublists each of which contains at least onefifth of the elements.Let T(n) be the number of comparisons required to sort n elements.Then: A. T(n)<=2T(n/5)+n B. T(n)<=T(n/5)+T(4n/5)+n C. T(n)<=2T(4n/5)+n D. T(n)<=2T(n/2)+n
asked
Sep 21
in
Algorithms
by
Vaishnavi01
(
215
points)

76
views
quicksort
algorithms
sorting
timecomplexity
gate
0
votes
0
answers
17
# Binomial tree # Binomial Heap
What is Binomial tree please explain in easy words. Construct the Binomial heap for the following sequence of numbers 7,2,4,17,1,11,6,8,15,10,20. Also apply the operation of extracting the minimum key in the resulting binomial Heap.
asked
Sep 10
in
Algorithms
by
LavTheRawkstar
Active
(
5.2k
points)

43
views
algorithms
heap
sorting
datastructure
binomial
tree
btree
0
votes
0
answers
18
# 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.
asked
Sep 9
in
Algorithms
by
LavTheRawkstar
Active
(
5.2k
points)

38
views
algorithms
heap
heapsort
sorting
0
votes
0
answers
19
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.
asked
Aug 18
in
Algorithms
by
Sumit Singh Chauhan
Active
(
1.5k
points)

56
views
algorithms
sorting
comparisonbasedsorting
0
votes
0
answers
20
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}$
asked
Aug 18
in
DS
by
srestha
Veteran
(
103k
points)

121
views
algorithms
sorting
heap
binaryheap
timecomplexity
0
votes
0
answers
21
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; }
asked
Aug 18
in
Programming
by
srestha
Veteran
(
103k
points)

43
views
mergesort
algorithms
sorting
0
votes
0
answers
22
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
asked
Aug 2
in
Algorithms
by
Solarica Palit
(
215
points)

34
views
sorting
+1
vote
2
answers
23
Sorting
Could a binary search tree be built using o(n lg n) comparisons in the comparison model? Explain why or why not.
asked
Aug 2
in
Algorithms
by
Ravi Dubey
(
305
points)

54
views
sorting
algorithms
timecomplexity
testseries
+1
vote
0
answers
24
Massachusetts Institute of Technology Professors Ron Rivest and Srini Devadas
asked
Jul 30
in
Algorithms
by
Rishav Kumar Singh
Active
(
4.6k
points)

30
views
sorting
+2
votes
3
answers
25
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 onethird 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?
asked
Jul 30
in
Algorithms
by
Rishav Kumar Singh
Active
(
4.6k
points)

71
views
algorithms
sorting
timecomplexity
Page:
1
2
3
4
5
6
...
9
next »
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
IIT HYDERABAD M.Tech (RA) 3Years Winter Session Interview experience
INDIAN AIR FORCE
GATE BOOK _ TEST SERIES DOUBT_
Visualizing complex C code
GATE Book Test Series
Follow @csegate
Gatecse
Recent questions tagged sorting
Recent Blog Comments
@
44,019
questions
49,545
answers
162,708
comments
65,769
users