2017 © Pedro Peláez
 

library fizzbinary

a fund panel match lib

image

fizzday/fizzbinary

a fund panel match lib

  • Tuesday, December 20, 2016
  • by fizz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

FizzBinary

a binary tree with php (公排22复制php二叉树算法), (*1)

installation (安装)

  • 直接使用composer命令
composer require fizzday/fizzbinary
  • 或者写入composer.json
{
    "require": {
        "fizzday/fizzbinary": "dev-master"
    }
}

usage samples (使用示例)

示例

1
2         3
4   5     6     7
8 9 10 11 12 13 14 15
0: 1;
1: (2^0) ~ (2^1)
2: (2^1) ~ (2^2)
3: (2^2) ~ (2^3)

1. getLayers($id)

use Fizzday\FizzBinary\FizzBinary;

$id = 19;
$res = FizzBinary::getLayers($id);
print_r($res);

result (返回第几层), (*2)

5

param comment (参数说明), (*3)

  • $id 编号

variable field (变量字段), (*4)

id: 编号

2. getPids($id, $layers=0)

use Fizzday\FizzBinary\FizzBinary;

$id = 19;
$res = FizzBinary::getPids($id);
print_r($res);

result (匹配结果), (*5)

Array
(
    [0] => 9
    [1] => 4
    [2] => 2
    [3] => 1
)

param comment (参数说明), (*6)

  • $id 编号
  • $layers 限定层数

return field (返回字段), (*7)

返回上层人的编号

The Versions

20/12 2016

dev-master

9999999-dev

a fund panel match lib

  Sources   Download

MIT

by Avatar fizz