1
GATE CSE 2025 Set 1
Numerical
+1
-0
$$\text { The pseudocode of a function fun( ) is given below : }$$
fun(int A[0, .., n-1]) {
for i = 0 to n-2
for j=0 to n-i-2
if (A[]]>A[j + 1])
then swap A[j] and A[j+1]
}
Let $A[0, \ldots, 29]$ be an array storing 30 distinct integers in descending order. The number of swap operations that will be performed, if the function fun( ) is called with $A[0, \ldots, 29]$ as argument, is _________. (Answer in integer)
Your input ____
2
GATE CSE 2024 Set 2
Numerical
+1
-0
Let $A$ be an array containing integer values. The distance of $A$ is defined as the minimum number of elements in $A$ that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array [2, 5, 3, 1, 4, 2, 6] is __________
Your input ____
3
GATE CSE 2021 Set 1
MCQ (Single Correct Answer)
+1
-0.33
Consider the following array.
|
23 |
32 |
45 |
69 |
72 |
73 |
89 |
97 |
Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort above array in ascending order?
4
GATE CSE 2019
Numerical
+1
-0
An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is ______.
Your input ____
GATE CSE Subjects
Browse all chapters by subject
Theory of Computation
Operating Systems
Algorithms
Database Management System
Data Structures
Computer Networks
Software Engineering
Compiler Design
Web Technologies
General Aptitude
Discrete Mathematics
Programming Languages