Skip to content

Add a doubly linked list data structure #46

Description

@Suvanwita

Summary

Add a doubly linked list implementation to src/data_structures.

Requirements

  • Support creating an empty list.
  • Support inserting values at the head and tail.
  • Support inserting at a specific index when valid.
  • Support removing values from the head, tail, and arbitrary positions.
  • Support searching for a value and checking whether it exists.
  • Support traversing the list in both forward and reverse directions.
  • Support returning the list length and empty-state checks.
  • Handle invalid index operations consistently and document the behavior.

Testing

Add tests for:

  • empty list behavior
  • insertion at head/tail
  • insertion by index
  • removal from head/tail
  • removal by value or index
  • forward and reverse traversal
  • search and existence checks
  • invalid operations

Documentation

Document the public API and include a short usage example consistent with the repository’s existing data structure modules.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions