mrxacx/data-structures

data abstract structures

dev-main 2024-11-17 17:44 UTC

This package is auto-updated.

Last update: 2025-05-20 16:15:46 UTC


README

Essential data structures for computer science, now in PHP.

Tests Dependency vulnerability

๐Ÿš€ Summary

๐Ÿงพ Lists

LinearList ๐Ÿ”—

Values are stored in an array of unique items. Fetch, add, and remove operations have O(n) time complexity.

SortedList ๐Ÿ”—

Values are stored in a sorted array of unique items. While add and remove operations have O(n) time complexity, the search operation has O(n log n) time complexity.

LinkedList ๐Ÿ”—

Each value is stored once using object references. Fetch, add, and remove operations have O(n) time complexity.

๐Ÿ—๏ธ Stacks

Stack ๐Ÿ”—

Last-in-first-out (LIFO) data structure. Items are stored in an array.

LinkedStack ๐Ÿ”—

Last-in-first-out (LIFO) data structure. Items are stored using object references.

๐Ÿšถ๏ธ๏ธ Queues

Queue ๐Ÿ”—

First-in-first-out (FIFO) data structure. Items are stored in an array.

LinkedQueue ๐Ÿ”—

First-in-first-out (FIFO) data structure. Items are stored using object references.