1. Swap Nodes in Pairshistorical

    Given a linked list, swap every two adjacent nodes and return the head of the modified list. You must solve the problem without modifying node values (only node links may be changed).

  2. Reverse Linked List IIhistorical

    Given a singly linked list and positions left and right, reverse the nodes in that range and return the updated list.

  3. Reverse Linked Listhistorical

    Reverse a singly linked list.

  4. Reverse Nodes in k-Grouphistorical

    Reverse the nodes of the given linked list in groups of k and return the resulting list. If the number of nodes is not a multiple of k, leave the remaining nodes at the end unchanged.

  5. Add Two Numbershistorical

    You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each node stores a single digit.

  6. Remove Duplicates from Sorted List IIhistorical

    Given the head head of a sorted linked list, delete all nodes whose values are duplicated, leaving only values that appear once. Return the sorted linked list.

  7. Remove Duplicates from Sorted Listhistorical

    Given the head head of a sorted linked list, delete duplicate elements so that each value appears only once. Return the sorted linked list.

  8. Remove Nth Node From End of Listhistorical

    Given a linked list, remove the nth node from the end and return the head of the list. For example, given the linked list: 1->2->3->4->5, n = 2. after removing the nth node from the end, the list becomes 1->2->3->5.

  9. Palindrome Linked Listhistorical

    Determine whether a linked list is a palindrome.

  10. Palindrome Linked Listhistorical

    Determine whether a linked list is a palindrome.

  11. Linked List Cyclehistorical

    Given a linked list, determine whether it contains a cycle.

  12. Linked List Cycle IIhistorical

    Given a linked list, return the first node where the cycle begins. If the list has no cycle, return null.

  13. Rotate Listhistorical

    Given the head head of a linked list, rotate the list to the right by k positions.

  14. Linked List Cyclehistorical

    Given a linked list, determine whether it contains a cycle.

  15. Linked List Cycle IIhistorical

    Given a linked list, return the first node where the cycle begins. If the list has no cycle, return null.

  16. Intersection of Two Linked Listshistorical

    Write a program that finds the first node at which two singly linked lists intersect.

  17. Reorder Listhistorical

    Reorder a singly linked list by alternating nodes from the beginning and end, changing links without modifying node values.

  18. Partition Listhistorical

    Given the head head of a linked list and a value x, partition the list so that all nodes with values less than x come before nodes with values greater than or equal to x.

  19. Merge k Sorted Listshistorical

    Merge k sorted linked lists into one sorted linked list. Analyze and describe the complexity.

  20. Merge Two Sorted Listshistorical

    Merge two sorted linked lists into one new sorted linked list and return it. The new list is formed by splicing together all nodes from the two given lists.

  21. Odd Even Linked Listhistorical

    Given the head head of a singly linked list, group all nodes at odd positions together followed by all nodes at even positions, and return the reordered list.

  22. Sort Listhistorical

    Given the head head of a linked list, sort the list in ascending order and return the sorted list.

  23. Intersection of Two Linked Listshistorical

    Write a program that finds the first node at which two singly linked lists intersect.