Skip to content

Sort a Linked List #2450

Closed
Closed
@resilient-maximus

Description

@resilient-maximus

Given the head of a linked list, return the list after sorting it in ascending order.

Solution:
A divide and conquer algorithm similar to merge sort used in case of arrays. The linked list is recursively broken down to smaller lists and then sorted after which they are merged, thereby sorting the original linked list.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions