Download the PHP package slimapi/data-structure without Composer
On this page you can find all versions of the php package slimapi/data-structure. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download slimapi/data-structure
More information about slimapi/data-structure
Files in slimapi/data-structure
Package data-structure
Short Description A collection of reusable and efficient data structures for various use cases.
License MIT
Informations about the package data-structure
📚 SlimAPI - Data Structures
A collection of reusable and efficient data structures for various use cases.
Data Structure | Status |
---|---|
Sorted Linked List | ✅ Implemented |
Other structures (coming soon) | ⏳ Planned |
🔗 SlimAPI\DataStructure\SortedLinkedList
A linked list that automatically keeps your values sorted. Supports integers or strings.
✨ Features
- Automatic Sorting: Always keeps elements sorted.
- Customizable Direction: Sort in ascending (default) or descending order.
- Duplicate Prevention: Automatically ensures only unique elements are stored in the list.
- Operations: Insert O(n), remove O(n), count O(1), and iterate O(n) with ease.
📚 Usage Examples
✅ Adding Items to the List
Values are inserted while maintaining the sort order.
🔄 Changing Sort Direction
You can control the sorting order by specifying Direction::ASC
(default) or Direction::DESC
.
❌ Removing Items
Easily remove any value from the list.
🔢 Counting and Iterating
The list is both countable and iterable, perfect for large datasets.
📦 Installation
Add the dependency to your project:
🛠️ Local Development & Testing
Clone the repo, then use the power of make
to simplify your workflow:
📜 License
This project is licensed under the terms specified in the LICENSE file.
🌟 Get Involved
We welcome contributions and suggestions! Please report any issues in the issue tracker.