Skip to content

Conversation

@akshat-jnn
Copy link
Contributor

@akshat-jnn akshat-jnn commented Oct 2, 2022

Merge two sorted lists to make a single sorted list

How do we merge two sorted lists to make a single sorted list
@Namanjain6152
Copy link
Contributor

How do we merge two sorted lists to make a single sorted list

firstly make a dummy node and then iterate over both the list if you get the value of first list element less than second list element then add it to your dummy node and move further in first list and vice versa and finaly return dummyNode->next as your final answer

Copy link
Contributor Author

@akshat-jnn akshat-jnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge two sorted list to a single sorted list

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