Skip to content

Siddhi-31/Hybrid-Merge-Sort-Algorithm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Hybrid Merge Sort Implementation in C

This repository contains the implementation and explanation of the Hybrid Merge Sort Algorithm using the C programming language.

About Hybrid Merge Sort

Hybrid Merge Sort is an optimized version of Merge Sort. It combines Merge Sort with Insertion Sort to improve performance on small subarrays.

Merge Sort is efficient for large datasets, while Insertion Sort performs better for small arrays due to lower overhead. Hybrid Merge Sort switches to Insertion Sort when the subarray size becomes small.

Algorithm Steps

Divide the array into two halves.

Recursively apply Hybrid Merge Sort to each half.

If the subarray size becomes smaller than a threshold (e.g., 10 elements), use Insertion Sort.

Merge the sorted subarrays.

Time Complexity Case Complexity Best Case O(n log n) Average Case O(n log n) Worst Case O(n log n) Space Complexity

O(n)

Example

Input

8 3 1 7 0 10 2

Sorted Output

0 1 2 3 7 8 10

About

Implementation and analysis of the Quick Sort algorithm in Java demonstrating divide-and-conquer sorting with complexity analysis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 100.0%