
Time Complexity Review
Authored by Angel Coronel
Computers
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following best describes the differences between selection sort, merge sort, and insertion sort?
Selection sort repeatedly selects the smallest element, merge sort divides and merges, and insertion sort places each element into its correct position.
Merge sort uses recursion, selection sort uses dynamic programming, and insertion sort uses hash tables.
Selection sort and merge sort have the same time complexity, while insertion sort is the fastest in all cases.
Insertion sort and merge sort are cool, but selection sort is not.
Answer explanation
Selection sort finds the minimum element repeatedly
Merge sort divides and then merges sorted parts
Insertion sort places elements one at a time in the correct position
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the average time complexity of selection sort, merge sort, and insertion sort, respectiv
O(n²), O(n log n), O(n)
O(n log n), O(n²), O(n²)
O(n²), O(n log n), O(n²)
O(n log n), O(n log n), O(n log n)
Answer explanation
Selection and Insertion sorts have an average time complexity of O(n²) due to nested loops
Merge sort is more efficient at O(n log n) due to its divide-and-conquer approach
3.
FILL IN THE BLANK QUESTION
1 min • 1 pt
The time complexity of bubble sort is...
Answer explanation
Bubble sort has O(n²) time complexity on average due to the need for repeated passes through the array to swap adjacent elements until fully sorted
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Why does merge sort require additional space compared to selection and insertion sort?
Merge sort requires extra space for recursive calls.
Merge sort needs temporary arrays to merge sorted halves.
Merge sort only sorts in-place with no extra space.
Merge sort uses more memory due to inefficient looping.
Answer explanation
Merge sort divides the array and requires temporary storage for the sorted halves during merging, increasing its space complexity to O(n)
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
The time complexity of a nested for loop that iterates n times in outer-loop and 50 times in inner-loop is...
Answer explanation
A single loop iterates through each element once and does 50 calculations per element, resulting in linear time complexity, O(50*n) which is O(n)
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the time complexity to find an element in an unsorted singly linked list?
O(1)
O(n)
O(log n)
O(n²)
Answer explanation
In an unsorted linked list, you must traverse each node until the element is found, leading to O(n) time complexity.
7.
FILL IN THE BLANK QUESTION
1 min • 1 pt
An algorithm that divides its input in half with each recursive call, like binary search, has a time complexity of...
Answer explanation
Dividing the problem size by 2 with each step leads to a logarithmic number of calls
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
10 questions
Node.js
Quiz
•
University
10 questions
6ta generación de computadoras
Quiz
•
University
10 questions
paquetes contables lección 1
Quiz
•
11th Grade - Professi...
10 questions
Memorias
Quiz
•
University
12 questions
Centros de datos perimetral
Quiz
•
University
15 questions
Computer Science Quiz
Quiz
•
University
8 questions
Câu hỏi về phần mềm Kodu
Quiz
•
1st Grade - University
10 questions
Modelo Cliente/Servidor
Quiz
•
University
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Computers
8 questions
2 Step Word Problems
Quiz
•
KG - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
10 questions
14.2 Independent/Dependent Variables
Quiz
•
KG - University
18 questions
Great Lakes States
Quiz
•
KG - University
7 questions
DNA, Chromosomes, Genes, and Traits: An Intro to Heredity
Interactive video
•
11th Grade - University
7 questions
Reflexive Verbs in Spanish
Lesson
•
9th Grade - University
7 questions
Narrative Writing 1
Interactive video
•
4th Grade - University
