Skip to content

Commit fc580e3

Browse files
committed
Merge branch 'main' of https://github.com/danizus/app
2 parents 1d78f54 + 2b92396 commit fc580e3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sorting/ReadMe.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,13 @@
2020
- **Algorithm**: Insertion Sort builds the sorted portion of the array one element at a time. It iterates through the unsorted portion and repeatedly takes an element from there and inserts it into the correct position in the sorted portion. This process continues until the entire array is sorted.
2121
- **Details**: Insertion Sort is a fundamental sorting algorithm often used for teaching sorting concepts and basic algorithmic analysis. It's simple to understand and implement, making it a valuable tool for educational purposes. However, like Bubble Sort, it's not efficient for sorting large datasets in real-world applications. It excels when dealing with nearly sorted data or small lists but becomes inefficient as the input size grows due to its quadratic time complexity.
2222
- **note**: Swapping is not done here, shifting and inserting is done here .
23+
24+
25+
26+
# Merge Sort
27+
28+
- **Time Complexity**: O(n log n) - linearithmic time.
29+
- **Space Complexity**: O(n) - linear space.
30+
- **Use Case**: Suitable for both educational purposes and real-world applications, especially for large datasets.
31+
- **Algorithm**: Merge Sort is a divide-and-conquer algorithm. It divides the unsorted array into smaller subarrays, recursively sorts each subarray, and then merges them to produce a sorted array.
32+
- **Details**: Merge Sort is a highly efficient sorting algorithm with a time complexity of O(n log n). It is widely used for sorting large datasets in real-world applications. Merge Sort's divide-and-conquer approach and stable sorting make it a dependable choice when sorting efficiency is critical. While it consumes more memory compared to some other sorting algorithms, its performance benefits often outweigh this drawback, especially when dealing with sizable datasets. Merge Sort's efficiency makes it a staple in software development for various applications, including sorting, searching, and data manipulation tasks.

0 commit comments

Comments
 (0)