insertion sort
Quiz
•
Information Technology (IT)
•
University
•
Practice Problem
•
Medium
Amina Amina
Used 3+ times
FREE Resource
Enhance your content in a minute
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is Insertion Sort
is a non-comparison sorting algorithm that sorts elements by counting the number of occurrences of each unique element.
builds the final sorted array one item at a time by comparing each new item to the already sorted items and inserting it into the correct position.
repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
is an in-place comparison sorting algorithm that divides the input list into two parts: the sorted part at the front and the unsorted part at the back.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How it works?(insertion sort)
1. Assume the first element is sorted.
2. Take the next element and insert it into the sorted portion of the array at the correct position.
3. Repeat until all elements are sorted.
1. Iterate over the list multiple times. 2. Compare each pair of adjacent items.
3. Swap them if they are in the wrong order.
4. Repeat until no swaps are needed
1. Initial State: Entire array is unsorted.
2. Find the minimum element in the unsorted array.
3. Swap it with the first unsorted element.
4. Repeat steps 2-3 for the remaining unsorted portion
1. Find the range (maximum value) of the input elements. 2. Initialize a count array of this range.
3. Count the occurrence of each element.
4. Modify the count array by adding the previous counts
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Time Complexity?(insertion sort)
Best: O(n)
Average: O(n)
Worst:O(n)^2
All:O(n)
Best:O(n)
Worst and Average: O(n^2)
Best: O(n^2)
Worst and Average:O(n+k)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Space Complexity(insertion sort)
O(n)
O(1)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the advantages of the insertion sort?
Linear time complexity for a fixed range of input.
Efficient for sorting integers.
Simple to understand and implement. Efficient for large datasets
Simple to implement. Performs well on small lists
Efficient for small data sets. Stable and in-place. Works well on nearly sorted data
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Insertion sort stability? and in place?
stable
in place
no stable
in place
no stable
no in place
stable
no in place
Similar Resources on Wayground
11 questions
13YO - Effective Presentation Skills and Techniques
Quiz
•
8th Grade - University
10 questions
ASSESSING HARDWARE
Quiz
•
University
10 questions
10 ARTIFICIAL INTELLIGENCE
Quiz
•
10th Grade - University
10 questions
QA Knowledge Challenge
Quiz
•
University
10 questions
Fundamentos de Programación en Python
Quiz
•
6th Grade - University
10 questions
Introduction to Computer Science Concepts
Quiz
•
6th Grade - University
10 questions
Asesmen Harian 1
Quiz
•
11th Grade - University
10 questions
CHAPTER 2: SYSTEM ANALYSIS AND DESIGN
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Information Technology (IT)
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University
