PHPackages                             localheinz/data-structure - 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. localheinz/data-structure

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

localheinz/data-structure
=========================

Provides implementations of data structures.

20[5 issues](https://github.com/localheinz/data-structure/issues)PHP

Since Sep 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/localheinz/data-structure)[ Packagist](https://packagist.org/packages/localheinz/data-structure)[ RSS](/packages/localheinz-data-structure/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

data-structure
==============

[](#data-structure)

[![CI Status](https://github.com/localheinz/data-structure/workflows/Continuous%20Integration/badge.svg)](https://github.com/localheinz/data-structure/actions)[![codecov](https://camo.githubusercontent.com/12d0434d3feba70652a426d4ce13ebf6fc6251993d2dd967e9fb27a1a3258773/68747470733a2f2f636f6465636f762e696f2f67682f6c6f63616c6865696e7a2f646174612d7374727563747572652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/localheinz/data-structure)[![Latest Stable Version](https://camo.githubusercontent.com/119e6d390cd4e4676c3a5ce715b5c4332dab8d514a659c001e8754b0a8dbbbbd/68747470733a2f2f706f7365722e707567782e6f72672f6c6f63616c6865696e7a2f646174612d7374727563747572652f762f737461626c65)](https://packagist.org/packages/localheinz/data-structure)[![Total Downloads](https://camo.githubusercontent.com/943eede41997ca22655946b7c2e2e4ac428fa77bf18197e77b41763c38b3a409/68747470733a2f2f706f7365722e707567782e6f72672f6c6f63616c6865696e7a2f646174612d7374727563747572652f646f776e6c6f616473)](https://packagist.org/packages/localheinz/data-structure)

This package provides implementations of data structures.

Installation
------------

[](#installation)

Run

```
$ composer require localheinz/data-structure

```

Data Structures
---------------

[](#data-structures)

- `Localheinz\DataStructure\Queue`
- `Localheinz\DataStructure\Stack`

### Queue

[](#queue)

```
use Localheinz\DataStructure\Queue;

$queue = new Queue();

$queue->isEmpty(); // true
$queue->isFull(); // false

$queue->enqueue('foo');
$queue->enqueue('bar');
$queue->isEmpty(); // false
$queue->isFull(); // false

$queue->dequeue(); // 'foo'
$queue->dequeue(); // 'bar'
$queue->isEmpty(); // true
$queue->isFull(); // false

$maxSize = 1;

$anotherQueue = new Queue($maxSize);

$anotherQueue->enqueue('foo');
$anotherQueue->isFull(); // true
```

### Stack

[](#stack)

```
use Localheinz\DataStructure\Stack;

$stack = new Stack();

$stack->isEmpty(); // true
$stack->isFull(); // false

$stack->push('foo');
$stack->push('bar');
$stack->isEmpty(); // false
$stack->isFull(); // false

$stack->peek(); // 'bar'

$stack->pop(); // 'bar'
$stack->pop(); // 'foo'
$stack->isEmpty(); // true
$stack->isFull(); // false

$maxSize = 1;

$anotherStack = new Stack($maxSize);

$anotherStack->push('foo');
$anotherStack->isFull(); // true
```

Changelog
---------

[](#changelog)

Please have a look at [`CHANGELOG.md`](CHANGELOG.md).

Contributing
------------

[](#contributing)

Please have a look at [`CONTRIBUTING.md`](.github/CONTRIBUTING.md).

Code of Conduct
---------------

[](#code-of-conduct)

Please have a look at [`CODE_OF_CONDUCT.md`](.github/CODE_OF_CONDUCT.md).

License
-------

[](#license)

This package is licensed using the MIT License.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cabc9efd157e2b47aa5aa9830180f5ebd07813cc3e93ff1a9993b2c3d264909?d=identicon)[localheinz](/maintainers/localheinz)

---

Top Contributors

[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (90 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (3 commits)")

### Embed Badge

![Health badge](/badges/localheinz-data-structure/health.svg)

```
[![Health](https://phpackages.com/badges/localheinz-data-structure/health.svg)](https://phpackages.com/packages/localheinz-data-structure)
```

###  Alternatives

[veewee/reflecta

Unleash the Power of Optics in your code!

12261.1k3](/packages/veewee-reflecta)[badcow/phrase-generator

Generate an English adjective-noun pair as a phrase (e.g. SubmissiveMonkey).

145.2k](/packages/badcow-phrase-generator)

PHPackages © 2026

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