CPSC1050 Sorting Algorithm

Quiz
•
Computers
•
University
•
Hard
W Mao
Used 5+ times
FREE Resource
6 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
3 mins • 5 pts
Which element of the array is sorted (in its final correct position) after the first pass of the insertion sort?
2.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
What would the following array look like after the first pass of the bubble sort algorithm (sort in ascending order)?
33, -5, 12, -4, 13, 5, 0, 11, 2, 28
-5, -4, 33, 12, 13, 5, 0, 2, 11, 28
-5, 12, -4, 13, 5, 0, 11, 2, 28, 33
-4, -5, 12, 13, 5, 0, 11, 2, 28, 33
-5, -4, 0, 2, 5, 11, 12, 13, 28, 33
3.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
What would the following array look like after the first pass of the insertion sort algorithm (sort in ascending order)?
33, -5, 12, -7, 17, 5, 0, 11, 2, 28
0, -5, 12, -7, 17, 5, 0, 33, 2, 28
-7, -5, 12, 33, 17, 5, 0, 11, 2, 28
-5, 33, 12, -7, 17, 5, 0, 11, 2, 28
4.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
What would the following array look like after the first swap of the quick sort algorithm if the first item is considered as the pivot (sort in ascending order)?
3, -5, 12, 5, -3, 0, 11, 2, 20
3, -5, 2, 5, -3, 0, 11, 12, 20
3, -5, 2, 0, -3, 5, 11, 12, 20
-3, -5, 2, 0, 3, 5, 11, 12, 20
5.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
How many comparisons are needed to search for 35 in the following sorted array using Binary Search?
2, 12, 25, 33, 36, 52, 55, 67, 85, 90, 95, 100
12
3
4
5
6.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
Suppose we are sorting an array of nine integers using quicksort, and we have just finished the first partitioning with the array looking like this:
2 5 1 0 6 9 12 11 10
The pivot could be either the 6 or the 9.
The pivot could be the 6, but it is not the 9.
The pivot is not the 6, but it could be the 9.
Neither the 6 nor the 9 could be the pivot.
Similar Resources on Wayground
10 questions
Rapid Round 1

Quiz
•
University
10 questions
Kuis 3 - ASD (B)

Quiz
•
University
10 questions
Introduction to Arrays

Quiz
•
KG - University
10 questions
Quiz on Stacks and Data Structures 2

Quiz
•
University
10 questions
BCSC0006 - Quiz 1 - Arrays

Quiz
•
University
5 questions
Complexity Analysis Station [5]

Quiz
•
University
10 questions
AdvancedProgramming_intro

Quiz
•
University
10 questions
C++ Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University