menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Sorting al...
source image

Prodevelopertutorial

3w

read

338

img
dot

Image Credit: Prodevelopertutorial

Sorting algorithm 4: Merge Sort

  • Merge Sort is a divide-and-conquer based algorithm.
  • It sorts an array by dividing it into smaller halves and merging them.
  • It follows three steps - Divide, Conquer and Combine.
  • Divide the array into half recursively till we get only single elements.
  • Sort the left and right part of the array recursively.
  • Combine the left and right part into single sorted array.
  • The time complexity of merge sort is O(n log n).
  • A C implementation of merge sort with input/output example is provided.
  • The merge sorted array function merges two sorted arrays.
  • This summarizes the various steps to perform Merge Sort algorithm.

Read Full Article

like

20 Likes

For uninterrupted reading, download the app