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
9 questions
IB CS Topic 4.2

Quiz
•
11th - 12th Grade
6 questions
Topic 6.1 Video 2

Quiz
•
11th Grade
10 questions
C# Variables

Quiz
•
10th Grade
10 questions
SLR 9 - Advanced Programming Techniques - Part Two

Quiz
•
10th Grade
10 questions
Uji Kompetensi 2: Fungsi Spreadsheet

Quiz
•
10th Grade
10 questions
SOAL MODUL 4 : Pemahaman Looping dan Kondisional

Quiz
•
10th Grade - University
8 questions
J277 - 2.2 - Use of Arrays up to 2D

Quiz
•
10th Grade - University
10 questions
apcsa-1D array

Quiz
•
11th Grade
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade