pravocodes / Hacktoberfest2024

25 stars 227 forks source link

merged two sorted linked lists. #101

Open shalupatidar22 opened 4 days ago

shalupatidar22 commented 4 days ago

This pull request introduces a function that merges two sorted singly linked lists into one sorted linked list. The key changes include:

Node Structure: Defines the structure for linked list nodes with data and next pointers. Linked List Operations: create() and create2(): Initialize two linked lists from two separate arrays. merge(): Merges two pre-sorted linked lists into a new sorted linked list. display(): Recursively displays the contents of the linked list.