rafayrty/linkedlist-php
Composer 安装命令:
composer require rafayrty/linkedlist-php
包简介
This Package allows you to have a Linked List inside Your PHP Project
README 文档
README
A PHP Package Implementing Linked List, for the cases when it is actually costly to insert an element at the beginning of an array.
Installation
You can install the package via composer:
composer require rafayrty/linkedlist-php
Usage
$list = new Rafayrty\LinkedListPhp\SinglyList(); //Insert a New Node to the LinkedList $list->push(5); // -> returns the linkedlist //Remove the Last Node from the LinkedList $list->pop(); // -> returns value of deleted element //Remove the Initial Node from the LinkedList $list->shift(); // -> returns value of deleted node //Add a Node To Beginning of the LinkedList $list->unshift(5); // -> returns the linkedlist //Get a Node from a specific index $list->get(0); // -> returns the value of the node //Remove a Node from a specific index $list->remove(0); // -> returns the value of the deleted node //Convert Your LinkedList to an array $list->toArray(); // -> returns an array of linkedlist //Delete an Element from a specified index to deleteCount similar to JS array splice $list->splice($starting,$deletecount); // -> returns the linkedlist
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-19