Skip to content

Add a sort functionality to linked lists - #17981

Merged
Vexu merged 4 commits into
ziglang:masterfrom
Justus2308:master
Nov 24, 2023
Merged

Add a sort functionality to linked lists#17981
Vexu merged 4 commits into
ziglang:masterfrom
Justus2308:master

Conversation

@Justus2308

Copy link
Copy Markdown
Member

The algorithms provided by std.sort are currently only able to deal with slices and converting a linked list to a slice before sorting it is not exactly efficient so this is a different scenario than e.g. for ArrayLists (#3917).
I think in this case it would make sense to provide a specialised function for linked lists, especially for merge sort (which I have implemented here for std.SinglyLinkedList) as it can run in place on a linked list.

@Vexu
Vexu enabled auto-merge (squash) November 21, 2023 12:03
auto-merge was automatically disabled November 24, 2023 17:45

Head branch was pushed to by a user without write access

@Vexu
Vexu enabled auto-merge (squash) November 24, 2023 18:13
@Vexu
Vexu merged commit 8b10970 into ziglang:masterNov 24, 2023
@andrewrk

Copy link
Copy Markdown
Member

Reverted in e834e95

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Justus2308@andrewrk@Vexu