yabh

WebJar for yabh

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

yabh
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

yabh
WebJar for yabh
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jmdobry/yabh

Скачать yabh

Имя Файла Размер
yabh-1.0.1.pom
yabh-1.0.1.jar 20 KB
yabh-1.0.1-sources.jar 22 bytes
yabh-1.0.1-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/yabh/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>yabh</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/yabh/
implementation 'org.webjars.npm:yabh:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/yabh/
implementation ("org.webjars.npm:yabh:1.0.1")
'org.webjars.npm:yabh:jar:1.0.1'
<dependency org="org.webjars.npm" name="yabh" rev="1.0.1">
  <artifact name="yabh" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='yabh', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "yabh" % "1.0.1"
[org.webjars.npm/yabh "1.0.1"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

yabh

bower version npm version Circle CI npm downloads codecov Codacy

Yet another Binary Heap.

Quick Start

bower install --save yabh or npm install --save yabh.

import BinaryHeap from 'yabh';
// or
define(['yabh'], function (BinaryHeap) { ... });
// or
var BinaryHeap = require('yabh');
// or
var BinaryHeap = window.BinaryHeap;

var heap = new BinaryHeap();

heap.push(4);
heap.push(2);
heap.push(1);
heap.push(5);
heap.push(3);
heap.peak(); // 1

API

BinaryHeap([weightFunc][, compareFunc])
var heap = new BinaryHeap();
heap.weightFunc; // function (x) { return x; }
heap.compareFunc; // function (x, y) { return x === y; }
var heap = new BinaryHeap(function (x) { return x.value; });
heap.weightFunc; // function (x) { return x.value; }
heap.compareFunc; // function (x, y) { return x === y; }

```js
var heap = new BinaryHeap(null, function (x, y) { return x == y; });
heap.weightFunc; // function (x) { return x; }
heap.compareFunc; // function (x, y) { return x == y; }
BinaryHeap#push(node) & BinaryHeap#pop()
var heap = new BinaryHeap();
heap.push(1);
heap.push(10);
heap.push(4);
heap.push(2);
heap.pop(); // 1
heap.pop(); // 2
heap.pop(); // 4
heap.pop(); // 10
BinaryHeap#peak()
var heap = new BinaryHeap();
heap.push(1);
heap.push(10);
heap.push(4);
heap.push(2);
heap.peek(); // 1
heap.pop(); // 1
heap.peek(); // 2
heap.pop(); // 2
heap.peek(); // 4
heap.pop(); // 4
heap.peek(); // 10
heap.pop(); // 10
BinaryHeap#remove(node)
var heap = new BinaryHeap();
heap.push(1);
heap.push(10);
heap.push(2);
heap.remove(10); // 10
heap.peek(); // 1
heap.remove(1); // 1
heap.peek(); // 2
BinaryHeap#removeAll()
var heap = new BinaryHeap();
heap.push(1);
heap.push(10);
heap.push(2);
heap.removeAll();
heap.size(); // 0
BinaryHeap#size()
var heap = new BinaryHeap();
heap.push(1);
heap.push(10);
heap.push(4);
heap.push(2);
heap.size(); // 4

License

The MIT License (MIT)

Copyright (c) 2015-2016 Jason Dobry

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Версии библиотеки

Версия
1.0.1