Merge Sort

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

How do you implement a merge sort

1. break the array in half into a left array and right array 2. continue breaking up until you have atomic elements 3. use a merge algorithm and auxiliary array to bring the elements together using a comparison operation to determine which elements should be in a new position

What is the space complexity of merge sort

O(n)

What is the time complexity of merge sort

O(nlogn)

Is merge a stable algorithm

it can be depending on how the comparison is done when it reach atomic elements that are equal to each other

What is merge sort

merge sort is a divide and conquer based approach to sorting an algorithm. it is a recursive algorithm that involves breaking up the original array to the smallest possible piece and then merging it based off which piece is bigger or smaller

which elements of the merge sort algorithm are recursive

the breaking up of the orignal array into subarrays


Ensembles d'études connexes

Competency 2: Healthcare Classification Systems

View Set

A&P 2 respiration/immunity/blood exam 2

View Set

BLAW Exam 2 Part 2 (chapter 12,13)

View Set

Patterns PreTest 80% - COLLPREPMATH

View Set

2.3.3 Practice Questions PC Tools

View Set