0
0
DSA Goprogramming~5 mins

Merge Sort Algorithm in DSA Go - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main idea behind the Merge Sort algorithm?
Merge Sort divides the list into smaller parts, sorts each part, and then merges them back together in order.
Click to reveal answer
intermediate
What is the time complexity of Merge Sort in the average and worst cases?
The time complexity is O(n log n) for both average and worst cases, where n is the number of elements.
Click to reveal answer
intermediate
Why does Merge Sort use extra space?
Merge Sort uses extra space because it creates temporary arrays to hold sorted parts before merging them.
Click to reveal answer
beginner
Show the result of merging two sorted arrays: [1, 4, 7] and [2, 3, 6].
The merged sorted array is [1, 2, 3, 4, 6, 7].
Click to reveal answer
beginner
What are the two main steps in the Merge Sort algorithm?
1. Divide the array into halves until each part has one element.<br>2. Merge the parts back together in sorted order.
Click to reveal answer
What technique does Merge Sort use to sort data?
ADynamic programming
BGreedy approach
CDivide and conquer
DBrute force
What is the space complexity of Merge Sort?
AO(n)
BO(1)
CO(log n)
DO(n log n)
Which of these is NOT true about Merge Sort?
AIt sorts in place without extra space.
BIt works well on linked lists.
CIt has O(n log n) time complexity.
DIt is stable.
After dividing an array of 8 elements, how many single-element parts do you get?
A4
B8
C2
D16
What is the first step in the Merge Sort algorithm?
ASwap elements
BMerge two sorted arrays
CSort the entire array directly
DDivide the array into halves
Explain how the Merge Sort algorithm sorts an array step-by-step.
Think about breaking down the problem and then combining solutions.
You got /4 concepts.
    Describe the advantages and disadvantages of using Merge Sort.
    Consider speed, memory, and use cases.
    You got /4 concepts.