
Sorting Algorithms Quiz
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Damain Ross
Used 1+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Describe the closest thing to the selection sort algorithm?
To reverse the elements of an array
To find the maximum element in an array
To sort an array in descending order
To divide the list into sorted and unsorted portions
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
In selection sort, what happens after each pass if the algorithm aims to sort the elements in descending order?
The unsorted portion increases.
The array is completely sorted.
The smallest element is placed at the beginning.
The largest element is placed at the beginning.
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the main characteristic of bubble sort?
It uses a divide and conquer approach
It repeatedly compares and swaps adjacent elements
It minimizes the number of comparisons
It sorts the array in a single pass
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which sorting algorithm minimizes the number of swaps?
Merge Sort
Insertion Sort
Selection Sort
Bubble Sort
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What does the inner loop of the selection sort algorithm do?
void selectionSort(int arr[], int n) {
int i, j, minIndex, temp;
for (i = 0; i < n - 1; i++) {
minIndex = i;
for (j = i + 1; j < n; j++) {
if (arr[j] < arr[minIndex]) {
minIndex = j;
}
}
if (minIndex != i) {
temp = arr[i];
arr[i] = arr[minIndex];
arr[minIndex] = temp;
}
// Display the array after each iteration . Not necessary.
printf("After iteration %d: ", i + 1);
for (int k = 0; k < n; k++) {
printf("%d ", arr[k]);
}
printf("\n");
}
}
Counts the number of elements
Sorts the entire array
Finds the minimum element in unsorted portion
Finds the maximum element
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Assuming n is the number of elements in an array to be sorted, how many passes does bubble sort make at most on the array?
n
n - 1
n + 1
2n
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the main advantage of bubble sort?
It sorts in place
It requires less memory
It is easy to understand
It is the fastest sorting algorithm
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Asesmen Sumatif
Quiz
•
12th Grade
10 questions
Intro to Windows Server 2012
Quiz
•
12th Grade
20 questions
UNIT 3- DATA COMMUNICATION
Quiz
•
12th Grade
20 questions
System Computer : Al-Azhar
Quiz
•
9th - 12th Grade
10 questions
Khởi động
Quiz
•
9th - 12th Grade
10 questions
HT3.2- Validation and Reliability
Quiz
•
8th Grade - University
15 questions
History of Computers
Quiz
•
6th - 12th Grade
15 questions
Vocabulary of Computer
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
