localheinz / data-structure
该软件包已被废弃,不再维护。没有建议的替代软件包。
提供数据结构实现。
dev-master
2019-12-07 08:15 UTC
Requires
- php: ^7.2
Requires (Dev)
- ergebnis/php-cs-fixer-config: ~1.1.0
- infection/infection: ~0.13.6
- localheinz/composer-normalize: ^1.3.1
- localheinz/phpstan-rules: ~0.13.0
- localheinz/test-util: ~0.8.0
- phpstan/phpstan: ~0.11.19
- phpstan/phpstan-deprecation-rules: ~0.11.2
- phpstan/phpstan-strict-rules: ~0.11.1
- phpunit/phpunit: ^8.5.0
This package is auto-updated.
Last update: 2019-12-07 08:16:41 UTC
README
此软件包提供数据结构的实现。
安装
运行
$ composer require localheinz/data-structure
数据结构
Localheinz\DataStructure\Queue
Localheinz\DataStructure\Stack
队列
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
栈
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.md
。
贡献
请查看CONTRIBUTING.md
。
行为准则
许可证
本软件包使用MIT许可证授权。