Linked lists are a fundamental data structure in computer science. This page provides a list of exercises to help you understand and practice linked lists.

Exercises

  1. Reverse a Linked List Write a function to reverse a singly linked list.

  2. Merge Two Sorted Lists Given two sorted linked lists, merge them into one sorted list.

  3. Remove Duplicates from Sorted List Given a sorted linked list, delete all duplicates such that each element appear only once.

  4. Detect a Loop in a Linked List Given a linked list, determine if it has a loop.

  5. Delete a Node in a Linked List Given a linked list and a value, delete the node with that value.

  6. Find the Middle of a Linked List Given a linked list, find the middle element.

  7. Palindrome Linked List Determine if a linked list is a palindrome.

  8. Intersection of Two Linked Lists Given two linked lists, determine if they intersect.

Resources

For more information and resources on linked lists, please visit our Data Structures page.


Linked List Illustration