承接 sorted-list/sorted-list 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sorted-list/sorted-list

最新稳定版本:1.1.0

Composer 安装命令:

composer require sorted-list/sorted-list

包简介

The package provides sorted list class.

README 文档

README

The package provides sorted list class with methods to work with sorted list.

How to install

Add the package

composer require sorted-list/sorted-list

How to use

Create a class SortedList

use SortedList\SortedList;

$sortedList = new SortedList();

Methods

  1. Add new value to sorted list
$sortedList->put($value);
  1. Get sorted list
$sortedList->get();
  1. Check if value exists in sorted list
$sortedList->exists($value);
  1. Get leftmost position of new value
$sortedList->leftPosition($value);
  1. Get rightmost position of new value
$sortedList->rightPosition($value);
  1. Get minimum and maximum value respectively
$sortedList->getMin();
$sortedList->getMax();
  1. Extract minimum and maximum value respectively
$sortedList->popMin();
$sortedList->popMax();

Unit tests

  1. Install unit test package
composer install --dev
  1. Run unit tests
./vendor/bin/phpunit

统计信息

  • 总下载量: 186
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2023-11-01