Q1:
2026: 21 May Shift 1
Computer Science
Sorting
Easy
Computer Science
Any algorithm that has a loop (usually 1 to n) will have the time complexity as ________.
2026: 21 May Shift 1
Computer Science
Sorting
Easy
Computer Science
Any algorithm that has a loop (usually 1 to n) will have the time complexity as ________.
2026: 20 May Shift 1
Computer Science
Sorting
Hard
Computer Science
Given an array as [22, 20 30, 10, 2, 8]. What will be the position of element 2 after 2 iterations of selection sort and insertion sort, respectively?
Note: Indexing of the array starts from 0.
(A) 0
(B) 3
(C) 4
(D) 5
2026: 20 May Shift 1
Computer Science
Sorting
Easy
Computer Science
The technique that sorts an array by comparing adjacent elements and swapping them if they are unordered is __________.
2026: 20 May Shift 1
Computer Science
Sorting
Easy
Computer Science
Any algorithm that does not have a loop will have time complexity as ____.
2026: 20 May Shift 1
Computer Science
Sorting
Medium
Computer Science
Consider an array [22, 20, 30, 10, 2, 8]. What will be the array after 2 passes of bubble sort?
2026: 19 May Shift 1
Computer Science
Sorting
Medium
Computer Science
How many comparisons are required to sort the list [8,7,6,5,4] using bubble sort?
2026: 19 May Shift 1
Computer Science
Sorting
Easy
Computer Science
Which of the following statements are correct?
(A) The bubble Sort technique sorts a given list of elements by repeatedly comparing the adjacent elements and swapping them if they are unordered.
(B) The process of placing or rearranging a collection of elements into a particular order is known as sorting.
(C) In selection Sort, the smallest element is selected from the unsorted array and swapped with the leftmost element.
(D) Complexity analysis does not depend on size of input.
2026: 19 May Shift 1
Computer Science
Sorting
Easy
Computer Science
With which of the following sorting techniques, the list is divided into two parts - one of sorted elements and another of unsorted elements. Each element in the unsorted list is considered one by one and is inserted into the sorted list at its appropriate position. At each pass, the sorted list is traversed from the backward direction to find the position where the unsorted element could be inserted.
2026: 19 May Shift 1
Computer Science
Sorting
Medium
Computer Science
Consider a list of elements:
numList =[8,7,13,1,-9,4].
Determine the partially sorted list after three complete passes of the list using insertion sort.
2026: 18 May Shift 2
Computer Science
Sorting
Medium
Computer Science
Given below is the code for Selection sort procedure:
SELECTIONSORT( numList, n)
Step 1: SET i=0
Step 2: WHILE i< n REPEAT STEPS 3 to 11
Step 3: SET min = i, flag = 0
Step 4: _______________
Step 5: WHILE j<="" p="">
Step 6: ___________________________
Step 7: min=j
Step 8: __________
Step 9: IF flag=1 THEN
Step 10: swap(numList[i],numList[min])
Step 11: ________________________
Arrange the options given below in order to fill in the blanks in the above code.
A. SET i=i+1
B. SET j= i+1
C. IF numList[j] < numList[min] THEN
D. flag=1
2026: 18 May Shift 2
Computer Science
Sorting
Easy
Computer Science
Complexity Analysis of algorithms is performed to explain how an algorithm will perform when the input _______________.
2026: 18 May Shift 2
Computer Science
Sorting
Medium
Computer Science
Match the LIST-I with LIST-II
| LIST-I | LIST-II | ||
|---|---|---|---|
| A. | Bubble sort | I. | Repeatedly compare adjacent elements |
| B. | Insertion sort | II. | Constant time algorithms |
| C. | Algorithm with nested loop | III. | Quadratic time algorithms |
| D. | Algorithms with no loops | IV. | Places elements in sorted list one by one |
2026: 18 May Shift 2
Computer Science
Sorting
Medium
Computer Science
What will be the result after second pass of bubble sort for an unsorted list given as follows?
[8,7,13,1,-9,4]
2026: 13 May Shift 2
Computer Science
Sorting
Medium
Computer Science
Consider the 'numList' having the elements as follows:
numList =[9,8,12,1,-8,3].
What will be the partially sorted list after three complete passes of Bubble sort?
2026: 13 May Shift 2
Computer Science
Sorting
Easy
Computer Science
What will be the running time complexity of an algorithm that does not have any loop?
2026: 13 May Shift 2
Computer Science
Sorting
Easy
Computer Science
The process of ordering or arranging a given collection of elements in some particular order is called ____________.
2026: 13 May Shift 2
Computer Science
Sorting
Medium
Computer Science
Identify the number of swaps required for sorting the list 'num' using selection sort.
num=[63,42,21,9]
2026: 11 May Shift 2
Computer Science
Sorting
Medium
Computer Science
What is the status of list after PASS-3 using Insertion Sort on the List [8,7,13,1,-9,4] ?
2026: 11 May Shift 2
Computer Science
Sorting
Easy
Computer Science
______________ sort places the element of a list at its suitable place in each pass. It is similar to the placing of cards at its right position while playing cards.
2026: 11 May Shift 2
Computer Science
Sorting
Easy
Computer Science
____________ is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements in case they are unordered in n-1 passes.
2026: 11 May Shift 2
Computer Science
Sorting
Medium
Computer Science
Assume that bubble sort is applied on the array [9,7,14,3,-7,5].
Arrange the following outputs of different passes in their correct order.
A. [-7,3,5,7,9,14]
B. [3,-7,5,7,9,14]
C. [7,3,-7,5,9,14]
D. [7,9,3,-7,5,14]
2025: 3 June Shift 2
Computer Science
Sorting
Easy
Computer Science
If the list have 'n' elements then how many passes/iteration will the selection sort take to sort the array?
2025: 3 June Shift 2
Computer Science
Sorting
Medium
Computer Science
Which of the following sorting algorithm has a worst case time complexity but performs well when the array is nearly sorted?
2025: 3 June Shift 2
Computer Science
Sorting
Hard
Computer Science
Consider the following array [8, 7, 13, 1, -9, 4]. After the iteration of Bubble sort, how will the array look like?
2025: 30 May Shift 2
Computer Science
Sorting
Easy
Computer Science
Apply bubble sort technique to sort a list of elements:
numList2 = [8, 7, 6, 5, 4]. Show the positions of elements in the list after pass 1.
2025: 30 May Shift 2
Computer Science
Sorting
Medium
Computer Science
Identify the purpose of the given algorithm :
Step 1: SET i = 0
Step 2: WHILE i< n, REPEAT STEPS 3 to 8
Step 3: SET j = 0
Step 4: WHILE j< n-i-1, REPEAT STEPS 5 to 7
Step 5: IF numList[j] < numList[j+1] THEN
Step 6: swap(numList[j], numList[j+1])
Step 7: SET j=j+1
Step 8: SET i=i+1
2025: 30 May Shift 2
Computer Science
Sorting
Medium
Computer Science
In the following list, bubble sort technique has been applied to sort a list of elements.
numList2 = [8, 7, 6, 5, 4]
Arrange the list after each pass in order :
(A) [7, 6, 5, 4, 8]
(B) [5, 4, 6, 7, 8]
(C) [8, 7, 6, 5, 4]
(D) [6, 5, 4, 7, 8]
2025: 27 May Shift 2
Computer Science
Sorting
Medium
Computer Science
In the context of the Selection Sort Algorithm for ascending order, arrange the following sequences:
(A) The list is considered to be divided into two lists - the left list contains sorted elements, while the right list contains unsorted elements.
(B) The smallest element is then swapped with the leftmost element of the unsorted element.
(C) This process continues until n - 1 smallest elements are found and moved to their respective places.
(D) All the elements in the unsorted list are traversed to find the smallest element.
2025: 27 May Shift 2
Computer Science
Sorting
Easy
Computer Science
Time Complexity of Insertion Sort having 'n' elements in the list in the worst case is:
2025: 27 May Shift 2
Computer Science
Sorting
Medium
Computer Science
For the list [35, 9, 12, 51, 32, 21], how will the list elements look like after second pass in Bubble Sort?