paint-brush
How To Merge Two Sorted Listsby@rakhmedovrs
167,516 reads
167,516 reads

How To Merge Two Sorted Lists

by Ruslan Rakhmedov2mAugust 1st, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow
EN

Too Long; Didn't Read

The list should be made by splicing together the nodes of the first two lists. It could be singly linked or doubly linked. The number of nodes in both lists is in the range `[0, 50]`-100 <= 100` The first Linked node is usually called the head whereas the last one is called the tail. The solution has a solution and we’ll discuss it in terms of big O notation. We’re looking for a node with minimal value stored in it. We move the pointer to the next for LinkedList which has a head. We also need a current node for storing the link of the current node.
featured image - How To Merge Two Sorted Lists
Ruslan Rakhmedov HackerNoon profile picture
Ruslan Rakhmedov

Ruslan Rakhmedov

@rakhmedovrs

Senior Software Engineer. As a hobby I do competitive programming

Learn More
LEARN MORE ABOUT @RAKHMEDOVRS'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Ruslan Rakhmedov HackerNoon profile picture
Ruslan Rakhmedov@rakhmedovrs
Senior Software Engineer. As a hobby I do competitive programming

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here