Create merge_two_lists.py that implements merging of two sorted linked lists#3874
Create merge_two_lists.py that implements merging of two sorted linked lists#3874cclauss merged 9 commits intoTheAlgorithms:masterfrom
Conversation
Fixed formatting errors
|
Please let me know if there are any changes or additions I can make. |
|
@cclauss I'd appreciate some feedback and a code review for my pr, thanks! |
ghost
left a comment
There was a problem hiding this comment.
@dhruvmanila, check this out
Also well done
cclauss
left a comment
There was a problem hiding this comment.
I am struggling with why we need all this code to deliver the equivalent of list_one + list_two
|
@cclauss, @xcodz-dot I've simplified the file by importing the Node and LinkedList classes from https://github.com/TheAlgorithms/Python/blob/master/data_structures/linked_list/singly_linked_list.py |
|
I can not tell much but wait for @cclauss, I do not find importing relevent in this case |
…d lists (TheAlgorithms#3874) * Create merge_two_lists.py that implements merging of two sorted linked lists * Update merge_two_lists.py Fixed formatting errors * Fixed trailing whitespace * Change name of function to def __str__() * updating DIRECTORY.md * Imported classes from singly_linked_list.py * Update merge_two_lists.py * Update merge_two_lists.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
…d lists (TheAlgorithms#3874) * Create merge_two_lists.py that implements merging of two sorted linked lists * Update merge_two_lists.py Fixed formatting errors * Fixed trailing whitespace * Change name of function to def __str__() * updating DIRECTORY.md * Imported classes from singly_linked_list.py * Update merge_two_lists.py * Update merge_two_lists.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
…d lists (TheAlgorithms#3874) * Create merge_two_lists.py that implements merging of two sorted linked lists * Update merge_two_lists.py Fixed formatting errors * Fixed trailing whitespace * Change name of function to def __str__() * updating DIRECTORY.md * Imported classes from singly_linked_list.py * Update merge_two_lists.py * Update merge_two_lists.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
…d lists (TheAlgorithms#3874) * Create merge_two_lists.py that implements merging of two sorted linked lists * Update merge_two_lists.py Fixed formatting errors * Fixed trailing whitespace * Change name of function to def __str__() * updating DIRECTORY.md * Imported classes from singly_linked_list.py * Update merge_two_lists.py * Update merge_two_lists.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
…d lists
Describe your change:
Implemented a new algorithm that merges two sorted linked lists into one sorted linked list
Includes:
function that creates a linked list using the Node class from a Python array,
function that creates a string representation of a linked list (1->2->3),
function that merges two lists into one.
Checklist:
Fixes: #{$ISSUE_NO}.