Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
Apply exactly one pass of an ascending bubble sort to the values 6, 2, 8 and 4, kept in that order. Which arrangement results?
Computer Science
Medium
High School (9–10)
Algorithms, Programming and Logic › Algorithms and Problem-Solving
IGCSE
Created by
StemPy Lab
Apply exactly one pass of an ascending bubble sort to the values
6
6
6
,
2
2
2
,
8
8
8
and
4
4
4
, kept in that order. Which arrangement results?
The list
2
,
4
,
6
,
8
2, 4, 6, 8
2
,
4
,
6
,
8
The list
6
,
2
,
4
,
8
6, 2, 4, 8
6
,
2
,
4
,
8
The list
2
,
6
,
8
,
4
2, 6, 8, 4
2
,
6
,
8
,
4
The list
2
,
6
,
4
,
8
2, 6, 4, 8
2
,
6
,
4
,
8
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← The diagram shows the array Data with the values 14, 9, 23, 9, 31, 6, 18, 9 at the indexes 1 to 8. A linear search starts at index 1 and stops at the first 9 it finds. How many comparisons does it make?
An algorithm totals five values and then outputs Total / 5. The values are 13, 7, 22, 9 and 14. What is output? →
More on
Algorithms, Programming and Logic › Algorithms and Problem-Solving
Discussion (0)
Log in
to join the discussion.
Loading…
All questions on this topic →
Problems on this topic
This is the kind of long scenario question that ends Paper 2…
Hard
A delivery company adds a check digit to each parcel number…
Medium
Name the check in each case. Say whether it is validation or verification…
Easy
A bubble sort is changed so that it sorts in descending order: the comparison becomes IF…
Hard
All problems on this topic →