定制 matejicekvojtech/sorted-linked-list 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

matejicekvojtech/sorted-linked-list

最新稳定版本:0.1.0

Composer 安装命令:

composer require matejicekvojtech/sorted-linked-list

包简介

Sorted linked list library. Test task for ShipMonk

README 文档

README

This library was created as task for ShipMonk recruiting process.

Installation

composer require matejicekvojtech/sorted-linked-list

Usage

This list can hold integer or string values sorted in ascending order. Value types of items in single list cannot mix (all values are either integer or string).

Create list

use VM\LinkedList\Model\SortedList
/* ... */
$list = new SortedList();
// empty list

Insert value

$list->add(123);
// list: 123

$list->add(111);
// list: 111 -> 123

Find value

$item = $list->find(5);
// item: null (not found)

$item = $list->find(123);
// item: SortedListItem {value: 123, next: null}

$item = $list->find(111);
// item: SortedListItem {
//      value: 111,
//      next: SortedListItem {
//          value: 123,
//          next: null
//      }
//  }

Remove value

$list->remove(5);
// list: 111 -> 123 (not found)

$list->remove(111);
// list: 123

Author

Vojtěch Matějíček

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-15