5_Arrays — Bubble Sort

Quiz
•
Computers
•
10th - 11th Grade
•
Hard
Pratima SEEWOONAUTH
Used 24+ times
FREE Resource
5 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following statements is true about Bubble sort?
It works in a random order, swapping elements haphazardly.
It works by repeatedly swapping the adjacent elements if they are in the wrong order.
It compares adjacent elements to check whether they are in the wrong order.
It involves a repetitive iteration.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Bubble sort involves the use of a ________ "for" loop.
random
sequential
nested
serial
3.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following statements is true about Bubble sorting an array?
It requires several passes to reorder elements of an array.
It is the only method used for sorting arrays.
It involves comparison and swapping of elements.
Elements must be swapped regardless of order.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following piece of code (assume that the code is indented properly):
num = arr.array('i', [12, 3, 2, 6, 1])
for i in range(len(num)):
for j in range(0, len(num)-i-1):
if num[j] > num[j+1] :
num[j], num[j+1] = num[j+1], num[j]
12, 3, 2, 6, 1
12, 6, 3, 2, 1
1, 2, 3, 6, 12
returns an error
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
The given array is num = arr.array('i', [1, 2, 4, 3]). Bubble sort is used to sort the array elements. How many iterations will be done to sort the array with improvised version?
Similar Resources on Wayground
10 questions
Chapter 05 Worksheet

Quiz
•
10th Grade
10 questions
C#

Quiz
•
11th Grade
10 questions
AP CS A Unit 6 Quiz PRACTICE

Quiz
•
9th - 12th Grade
10 questions
ArrayLists

Quiz
•
11th - 12th Grade
7 questions
AP Comp (POP Quiz)

Quiz
•
9th - 12th Grade
10 questions
Reshaping & vStack&hstack( )

Quiz
•
9th Grade - University
5 questions
AP Computer Science A Unit 6 Lesson 1 (Introduction)

Quiz
•
10th - 12th Grade
8 questions
Quarter 4 Mastery Test - Programming 10

Quiz
•
9th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade