PHPackages                             adrianschubek/structures - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. adrianschubek/structures

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

adrianschubek/structures
========================

Basic linear &amp; tree structures

1.1(5y ago)110MITPHPPHP &gt;=7.4

Since Jul 16Pushed 5y agoCompare

[ Source](https://github.com/adrianschubek/structures)[ Packagist](https://packagist.org/packages/adrianschubek/structures)[ Docs](https://docs.adriansoftware.de/structures)[ RSS](/packages/adrianschubek-structures/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Structures
==========

[](#structures)

[![Latest Stable Version](https://camo.githubusercontent.com/b9fb36787970356573ec76394d8fc1a65355086d677922e90acf1dd695eaba54/68747470733a2f2f706f7365722e707567782e6f72672f61647269616e7363687562656b2f737472756374757265732f76)](//packagist.org/packages/adrianschubek/structures)[![Packagist PHP Version Support](https://camo.githubusercontent.com/7ec7ac91c9d31d846623b371092c4f25e0e4c7d840ebff11d9c37252f1d7464a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f61647269616e7363687562656b2f73747275637475726573)](https://camo.githubusercontent.com/7ec7ac91c9d31d846623b371092c4f25e0e4c7d840ebff11d9c37252f1d7464a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f61647269616e7363687562656b2f73747275637475726573)[![License](https://camo.githubusercontent.com/553f5488e91b0f068fd0b02e9c13f60a48fa2a3780e6854b6034707ef966f31b/68747470733a2f2f706f7365722e707567782e6f72672f61647269616e7363687562656b2f737472756374757265732f6c6963656e7365)](//packagist.org/packages/adrianschubek/structures)

This package intoduces multiple new data structures such as Trees, Lists and Wrappers.

### Data structures

[](#data-structures)

- Linear
    - Queue
    - Deque
    - Stack
    - List
- Tree
    - BinaryTree
    - BinarySearchTree
- Wrapper
    - StringWrapper
    - IntWrapper
    - FloatWrapper

### Get started

[](#get-started)

```
composer require adrianschubek/structures

```

### Examples

[](#examples)

Check `/tests` directory for more examples.

##### Queue

[](#queue)

```
use adrianschubek\Structures\Linear\Queue;

$queue = new Queue();
$queue->enqueue("Berlin");
$queue->enqueue("Munich");
$queue->enqueue("Cologne");

$queue->dequeue();

$arr = $queue->toArray();
// ==> ["Munich", "Cologne"]
```

##### List

[](#list)

```
use adrianschubek\Structures\Linear\DynamicList;

$list = new DynamicList();

$list->append("Berlin");
$list->append("Munich");
$list->append("Cologne");

$list2 = new DynamicList();
$list2->append("Düsseldorf");
$list2->append("Essen");

$list->concat($list2);
// ==> ["Berlin", "Munich", "Cologne", "Düsseldorf", "Essen"]
```

```
use adrianschubek\Structures\Linear\DynamicList;

$list = new DynamicList([
    "Berlin", "Munich", "Cologne"
]);

$list2 = new DynamicList([
    "Munich", "Cologne"
]);

$diff = $list->diff($list2);
// ==> ["Berlin"]
```

##### Deque

[](#deque)

```
use adrianschubek\Structures\Linear\Deque;

$deque = new Deque([
    "Berlin",
    "Munich",
    "Cologne"
]);

$deque->pop();

$ele = $deque->last();
// ==> "Munich"
```

##### BinaryTree

[](#binarytree)

```
use adrianschubek\Structures\Tree\BinaryTree;

$tree = new BinaryTree("Berlin");
$tree->setLeftTree(new BinaryTree("Hamburg"));
$tree->setRightTree(new BinaryTree("Munich"));

$ele = $tree->getLeftTree()->getContent();
// ==> "Hamburg"
```

##### BinarySearchTree

[](#binarysearchtree)

```
use adrianschubek\Structures\Tree\BinarySearchTree;
use adrianschubek\Structures\Wrapper\StringWrapper;

$tree = new BinarySearchTree("Berlin");
$tree->insert(new StringWrapper("Hamburg"));
$tree->insert(new StringWrapper("Munich"));
$tree->insert(new StringWrapper("Frankfurt"));
// OR
$tree = BinarySearchTree::fromArray(["Berlin", "Hamburg", "Munich", "Frankfurt"]);
// OR
$tree = BinarySearchTree::fromString("Berlin,Munich,Frankfurt,Hamburg");

$tree->search(new StringWrapper("Frankfurt"));
// ==> "Frankfurt"

$tree->search(new StringWrapper("Mainz"));
// ==> null
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

2

Last Release

2122d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/500782457c7bfa139f0c77fc085cceaf6114c39ff2e7551c32bedb36af2a759b?d=identicon)[adrian.schubek](/maintainers/adrian.schubek)

---

Top Contributors

[![adrianschubek](https://avatars.githubusercontent.com/u/19362349?v=4)](https://github.com/adrianschubek "adrianschubek (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adrianschubek-structures/health.svg)

```
[![Health](https://phpackages.com/badges/adrianschubek-structures/health.svg)](https://phpackages.com/packages/adrianschubek-structures)
```

###  Alternatives

[lizhichao/word

This is a participle library

59140.3k1](/packages/lizhichao-word)[rocket-labs/bloom-filter

Implementation of bloom filter

19121.9k](/packages/rocket-labs-bloom-filter)[mrssoft/yii2-sitemap

Yii2 sitemap extension

1123.9k1](/packages/mrssoft-yii2-sitemap)[pantheon-systems/site-audit-tool

Drush global extension to run Site Audit checks on Drush 8 and 9

1116.4k](/packages/pantheon-systems-site-audit-tool)[springimport/magento2-module-catalog-dropdown-sort

All sort options in dropdown in Catalog

103.8k](/packages/springimport-magento2-module-catalog-dropdown-sort)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
