Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/update-all
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien Ooms authored Jan 18, 2017
2 parents 150e600 + 403371b commit d8b2126
Show file tree
Hide file tree
Showing 39 changed files with 1,325 additions and 1,274 deletions.
7 changes: 3 additions & 4 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
languages:
JavaScript: true
exclude_paths:
- "js/dist/*.js"
- "js/dist/**/*.js"
- "test/*.js"
- "test/**/*.js"
- "doc/**"
- "lib/**"
- "test/**"
32 changes: 7 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules
jspm_packages

# Coverage directory used by nyc
coverage
.nyc_output

# groc
doc
# Documentation
gh-pages
7 changes: 0 additions & 7 deletions .groc.json

This file was deleted.

18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
language: node_js

node_js:
- "iojs"
- "0.12"
- "0.11"
- "0.10"
- node

install:
- npm -d install
- npm install

script:
- npm test
- npm run cover

after_success:
- ./node_modules/.bin/coveralls < coverage/lcov.info || true
- ./node_modules/.bin/codeclimate < coverage/lcov.info || true
- bash <(curl -s https://codecov.io/bash) || true
- coveralls < coverage/lcov.info || true
- codeclimate-test-reporter < coverage/lcov.info || true
151 changes: 3 additions & 148 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[js-binomial-heap](http://aureooms.github.io/js-binomial-heap)
==

Binomial heap code bricks in JavaScript. Parent is
[aureooms/js-heap](https://github.com/aureooms/js-heap).
Binomial heap data structures for JavaScript.
Parent is [aureooms/js-heap](https://github.com/aureooms/js-heap).

```js
//
Expand All @@ -18,160 +18,15 @@ Binomial heap code bricks in JavaScript. Parent is

[![NPM license](http://img.shields.io/npm/l/aureooms-js-binomial-heap.svg?style=flat)](https://raw.githubusercontent.com/aureooms/js-binomial-heap/master/LICENSE)
[![NPM version](http://img.shields.io/npm/v/aureooms-js-binomial-heap.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-binomial-heap)
[![Bower version](http://img.shields.io/bower/v/aureooms-js-binomial-heap.svg?style=flat)](http://bower.io/search/?q=aureooms-js-binomial-heap)
[![Build Status](http://img.shields.io/travis/aureooms/js-binomial-heap.svg?style=flat)](https://travis-ci.org/aureooms/js-binomial-heap)
[![Coverage Status](http://img.shields.io/coveralls/aureooms/js-binomial-heap.svg?style=flat)](https://coveralls.io/r/aureooms/js-binomial-heap)
[![Dependencies Status](http://img.shields.io/david/aureooms/js-binomial-heap.svg?style=flat)](https://david-dm.org/aureooms/js-binomial-heap#info=dependencies)
[![devDependencies Status](http://img.shields.io/david/dev/aureooms/js-binomial-heap.svg?style=flat)](https://david-dm.org/aureooms/js-binomial-heap#info=devDependencies)
[![Code Climate](http://img.shields.io/codeclimate/github/aureooms/js-binomial-heap.svg?style=flat)](https://codeclimate.com/github/aureooms/js-binomial-heap)
[![NPM downloads per month](http://img.shields.io/npm/dm/aureooms-js-binomial-heap.svg?style=flat)](https://www.npmjs.org/package/aureooms-js-binomial-heap)
[![GitHub issues](http://img.shields.io/github/issues/aureooms/js-binomial-heap.svg?style=flat)](https://github.com/aureooms/js-binomial-heap/issues)
[![Inline docs](http://inch-ci.org/github/aureooms/js-binomial-heap.svg?branch=master&style=shields)](http://inch-ci.org/github/aureooms/js-binomial-heap)

Can be managed through [jspm](https://github.com/jspm/jspm-cli),
[duo](https://github.com/duojs/duo),
[component](https://github.com/componentjs/component),
[bower](https://github.com/bower/bower),
[ender](https://github.com/ender-js/Ender),
[jam](https://github.com/caolan/jam),
[spm](https://github.com/spmjs/spm),
and [npm](https://github.com/npm/npm).

## Description

This package contains binomial heap implementations.


## Install

### jspm
```terminal
jspm install github:aureooms/js-binomial-heap
# or
jspm install npm:aureooms-js-binomial-heap
```
### duo
No install step needed for duo!

### component
```terminal
component install aureooms/js-binomial-heap
```

### bower
```terminal
bower install aureooms-js-binomial-heap
```

### ender
```terminal
ender add aureooms-js-binomial-heap
```

### jam
```terminal
jam install aureooms-js-binomial-heap
```

### spm
```terminal
spm install aureooms-js-binomial-heap --save
```

### npm
```terminal
npm install aureooms-js-binomial-heap --save
```

## Require
### jspm
```js
let binomialheap = require( "github:aureooms/js-binomial-heap" ) ;
// or
import binomialheap from 'aureooms-js-binomial-heap' ;
```
### duo
```js
let binomialheap = require( "aureooms/js-binomial-heap" ) ;
```

### component, ender, spm, npm
```js
let binomialheap = require( "aureooms-js-binomial-heap" ) ;
```

### bower
The script tag exposes the global variable `binomialheap`.
```html
<script src="bower_components/aureooms-js-binomial-heap/js/dist/binomial-heap.min.js"></script>
```
Alternatively, you can use any tool mentioned [here](http://bower.io/docs/tools/).

### jam
```js
require( [ "aureooms-js-binomial-heap" ] , function ( binomialheap ) { ... } ) ;
```

## Use

```js
// can choose between 3 different implementations
//
// - BinomialHeap( BinomialTreeWithParent )
// # head -> value
// # headreference -> reference
// # pop -> value
// # popreference -> reference
// # push( value ) -> reference
// # pushreference( reference )
// # merge( other )
// # update( reference , value )
// # decreasekey( reference , value )
// # increasekey( reference , value )
// # delete( reference )
//
// - BinomialHeap( BinomialTree )
// # head -> value
// # pop -> value
// # push( value )
// # merge( other )
//
// - LazyBinomialHeap( BinomialTree )
// # pop -> value
// # push( value )
// # merge( other )

let compare = require( "aureooms-js-compare" ) ;

let Heap = binomialheap. ... ( binomialheap. ... ) ;

let a = new Heap( compare.increasing ) ;
let b = new Heap( compare.increasing ) ;

a.push( 5 ) ;
a.push( 1 ) ;
a.push( 4 ) ;
b.push( 3 ) ;
b.push( 2 ) ;

a.length ; // 3
b.length ; // 2

a.merge( b ) ;
delete b ;

a.length ; // 5

a.pop( ) ; // 1
a.pop( ) ; // 2
a.pop( ) ; // 3
a.pop( ) ; // 4
a.pop( ) ; // 5

a.length ; // 0
```
[![Documentation](https://aureooms.github.io/js-binomial-heap/badge.svg)](https://aureooms.github.io/js-binomial-heap/source.html)

## Reference

- http://www.cs.princeton.edu/~wayne/cs423/lectures/heaps-4up.pdf

21 changes: 0 additions & 21 deletions bower.json

This file was deleted.

11 changes: 0 additions & 11 deletions component.json

This file was deleted.

52 changes: 52 additions & 0 deletions doc/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
h1,
h2,
.navigation,
.layout-container > header,
footer
{
border: none;
}

.project-name {
color: #FC913A;
font-weight: bold;
}

.layout-container > header > a.repo-url-github {
font-size: inherit;
display: inline;
background: none;
vertical-align: inherit;
}

.search-box img {
display: none;
}

.search-box::before{
content: "search";
}

.search-input-edge {
height: 0px;
}

.search-result {
width: 300px;
margin-left: 42px;
box-shadow: 1px 1px 13px rgba(0,0,0,0.2);
}

.search-input {
visibility: visible;
}

.search-result li.search-separator {
text-transform: capitalize;
background-color: #ccc;
}

span[data-ice="signature"] > span {
/*font-weight: bold;*/
font-style: italic;
}
57 changes: 57 additions & 0 deletions doc/manual/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

```js
// can choose between 3 different implementations
//
// - BinomialHeap( BinomialTreeWithParent )
// # head -> value
// # headreference -> reference
// # pop -> value
// # popreference -> reference
// # push( value ) -> reference
// # pushreference( reference )
// # merge( other )
// # update( reference , value )
// # decreasekey( reference , value )
// # increasekey( reference , value )
// # delete( reference )
//
// - BinomialHeap( BinomialTree )
// # head -> value
// # pop -> value
// # push( value )
// # merge( other )
//
// - LazyBinomialHeap( BinomialTree )
// # pop -> value
// # push( value )
// # merge( other )

let compare = require( "aureooms-js-compare" ) ;

let Heap = binomialheap. ... ( binomialheap. ... ) ;

let a = new Heap( compare.increasing ) ;
let b = new Heap( compare.increasing ) ;

a.push( 5 ) ;
a.push( 1 ) ;
a.push( 4 ) ;
b.push( 3 ) ;
b.push( 2 ) ;

a.length ; // 3
b.length ; // 2

a.merge( b ) ;
delete b ;

a.length ; // 5

a.pop( ) ; // 1
a.pop( ) ; // 2
a.pop( ) ; // 3
a.pop( ) ; // 4
a.pop( ) ; // 5

a.length ; // 0
```
Loading

0 comments on commit d8b2126

Please sign in to comment.