Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Sort using Linked List #283

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Merge Sort using Linked List #283

merged 2 commits into from
Oct 3, 2024

Conversation

amanvatss
Copy link
Contributor

Merge Sort using Linked Lists

Merge Sort is particularly well-suited for linked lists, leveraging their non-contiguous structure for efficient sorting. The process involves:

  1. Divide and Conquer: The list is recursively split into smaller halves until each sublist contains a single node, simplifying the sorting process.

2.Merging: Sorted sublists are then merged in O(n) time, requiring no additional memory, unlike array-based sorting.

3.Stability: The algorithm preserves the relative order of equal elements, ensuring a stable sort.

Fixes #261

Screenshot 2024-10-03 103609
Screenshot 2024-10-03 103707
Screenshot 2024-10-03 104455

@Saloni6111 Saloni6111 added the hacktoberfest-accepted contribute for hacktoberfest 2024 label Oct 3, 2024
@Saloni6111 Saloni6111 merged commit 7c4fcc7 into Saloni6111:main Oct 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted contribute for hacktoberfest 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge Sort Algorithm Using Linked List - Data Structures & Algorithms Concept
2 participants