Skip to content

Add deque, list, forward_list, and array containers #10

@AnshMNSoni

Description

@AnshMNSoni

Problem

The library currently supports vector, stack, and queue, but several foundational C++ sequence containers are missing. These are heavily used in competitive programming and systems design.


Missing Containers

Container C++ Equivalent Description
deque std::deque<T> Double-ended queue, O(1) push/pop from both ends
list std::list<T> Doubly linked list, O(1) insert/delete anywhere
forward_list std::forward_list<T> Singly linked list, memory efficient
array std::array<T, N> Fixed-size array with STL-style interface

Expected API (Example for deque)

from pythonstl import deque

d = deque()
d.push_front(1)
d.push_back(2)
d.pop_front()
d.pop_back()
print(d.front(), d.back(), d.size())

Checklist

  • deque
  • list
  • forward_list
  • array
  • Unit tests for each
  • Docstrings with time complexity annotations

Notes

  • deque should be the priority as it is used internally by queue and stack in C++ STL.
  • All containers should follow the same naming conventions used in existing containers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions