定制 kryshtalovich/algorithms 二次开发

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

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

kryshtalovich/algorithms

Composer 安装命令:

composer require kryshtalovich/algorithms

包简介

Sort and search algorithms

README 文档

README

In this repository I'm implementing various algorithms. Currently, a bubble sort algorithm and a binary search algorithm are implemented.

Installation

Require the package in composer.json

"require": {
    "kryshtalovich/algorithms": "1.*"
  }

Usage

Bubble sorting

use Kryshtalovich\Algorithms\Sorts\Bubble;

//any numeric array
$array = [9, 7, 5, 6, 545, 66, 0, 4];


Bubble::Sort($array);

var_dump($array);

Output:

array(8) {
  [0]=>
  int(0)
  [1]=>
  int(4)
  [2]=>
  int(5)
  [3]=>
  int(6)
  [4]=>
  int(7)
  [5]=>
  int(9)
  [6]=>
  int(66)
  [7]=>
  int(545)
}

Binary searching

use Kryshtalovich\Algorithms\Search\Binary;

//any numeric array
$array = [7, 7.5, 8, 8.3, 9.4];

$elementKey = Binary::Search($array, 8.3);

var_dump($elementKey);

Output:

int(3)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2020-11-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固