Split Linked List - Coding in a Smart Way
Given a linked list, split it into 2 sub linked lists, one for the first half, the other for the second half. If the number of elements is odd, the first half has one element more than the second half. For example, given a linked list ->1->2->3->4->5, return 2 linked lists ->1->2->3 and ->4->5.
Read full article from Split Linked List - Coding in a Smart Way
No comments:
Post a Comment