
Time Complexity Review

Quiz
•
Computers
•
University
•
Medium

Angel Coronel
Used 3+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
6 questions
SORTING

Quiz
•
University
16 questions
Searching & Sorting Algorithms

Quiz
•
10th Grade - University
14 questions
DC and DP Quiz

Quiz
•
University
10 questions
Time Complexity

Quiz
•
University
15 questions
Searching and Sorting

Quiz
•
University - Professi...
15 questions
Sorting

Quiz
•
University
15 questions
Ordenamiento&DivideVencerás

Quiz
•
University
15 questions
ANALYSIS OF ALGORITHMS

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade