Created
January 2, 2021 23:20
-
-
Save or9/269282bb538a1e2de84094a4cedea3f6 to your computer and use it in GitHub Desktop.
Sort linked list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "node": 1, "link": 4 }, | |
{ "node": 4, "link": 5 }, | |
{ "node": 5, "link": null }, | |
{ "node": 1, "link": 3 }, | |
{ "node": 3, "link": 4 }, | |
{ "node": 4, "link": null }, | |
{ "node": 2, "link": 6 }, | |
{ "node": 6, "link": null } | |
] | |
.map(({ node }) => node) | |
.sort(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment