Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 736 Bytes

File metadata and controls

22 lines (18 loc) · 736 Bytes

Singly Linked List Implementation in Java

A complete implementation of a generic singly linked list data structure with advanced operations.

Features

  • Core Operations:

    • Add/remove at head, tail, or any position
    • Get elements by position (from start or end)
    • Convert to array
    • List cloning
  • Advanced Operations:

    • Loop detection (Floyd's Cycle-Finding Algorithm)
    • Loop removal
    • List reversal (recursive)
    • Merge two linked lists
    • Find middle node (fast/slow pointer technique)
  • Utility Methods:

    • size(), isEmpty(), contains()
    • indexOf(), lastIndexOf()
    • print_list()-> (you can also implement object.toString() with the help of StringBuilder and print object instead)