Skip to content

Commit 5a1023b

Browse files
committed
typo
1 parent 4a05a7b commit 5a1023b

File tree

4 files changed

+39
-45
lines changed

4 files changed

+39
-45
lines changed

README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
[npm-image]: https://img.shields.io/npm/v/binaryheapx.svg?style=flat-square
1010
[npm-url]: https://npmjs.org/package/binaryheapx
11-
[travis-image]: https://img.shields.io/travis/xudafeng/BinaryHeap.svg?style=flat-square
12-
[travis-url]: https://travis-ci.org/xudafeng/BinaryHeap
13-
[coveralls-image]: https://img.shields.io/coveralls/xudafeng/BinaryHeap.svg?style=flat-square
14-
[coveralls-url]: https://coveralls.io/r/xudafeng/BinaryHeap?branch=master
11+
[travis-image]: https://img.shields.io/travis/doing-data-science/BinaryHeap.svg?style=flat-square
12+
[travis-url]: https://travis-ci.org/doing-data-science/BinaryHeap
13+
[coveralls-image]: https://img.shields.io/coveralls/doing-data-science/BinaryHeap.svg?style=flat-square
14+
[coveralls-url]: https://coveralls.io/r/doing-data-science/BinaryHeap?branch=master
1515
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
1616
[node-url]: http://nodejs.org/download/
1717
[download-image]: https://img.shields.io/npm/dm/binaryheapx.svg?style=flat-square
@@ -186,5 +186,3 @@ Returns the number of elements in this heap.
186186
## License
187187

188188
The MIT License (MIT)
189-
190-
Copyright (c) 2013 xdf

index.html

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<!DOCTYPE html>
22
<html>
3-
<head>
4-
<meta charset="UTF-8">
5-
<title>BinaryHeap - JavaScript Implementation of the Binary Heap.</title>
6-
<link rel="stylesheet" href="page/stylesheet/index.css" />
7-
<script src="page/javascript/jquery.min.js"></script>
8-
<script src="page/javascript/pillow.min.js"></script>
9-
<script src="page/javascript/markdown.min.js"></script>
10-
<script src="lib/BinaryHeap.js"></script>
11-
<base target="_blank"/>
12-
</head>
13-
<body>
14-
<div class="ribbon" style="position:fixed;right:0;top:0;width:150px;height:150px;overflow:hidden;z-index:9999;"><a target="_blank" style="display:inline-block;width:200px;overflow:hidden;padding:6px 0;text-align:center;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);-transform:rotate(45deg);text-decoration:none;color:#fff;position:inherit;top:45px;right:-40px;border-width:1px 0;border-style:dotted;border-color:rgba(255, 255, 255, 0.7);font:700 13px &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;box-shadow:0 2px 3px 0 rgba(0, 0, 0, 0.5);background-color:#a00;" href="//github.com/xudafeng/BinaryHeap.git">Fork me on Github</a></div>
15-
<div id="demonstrate">
16-
<canvas id="screen"></canvas>
17-
</div>
18-
<div id="docs"></div>
19-
<script src="page/javascript/index.js"></script>
20-
</body>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>BinaryHeap - JavaScript Implementation of the Binary Heap.</title>
6+
<link rel="stylesheet" href="page/stylesheet/index.css" />
7+
<script src="page/javascript/jquery.min.js"></script>
8+
<script src="page/javascript/pillow.min.js"></script>
9+
<script src="page/javascript/markdown.min.js"></script>
10+
<script src="lib/BinaryHeap.js"></script>
11+
<base target="_blank"/>
12+
</head>
13+
<body>
14+
<div class="ribbon" style="position:fixed;right:0;top:0;width:150px;height:150px;overflow:hidden;z-index:9999;"><a target="_blank" style="display:inline-block;width:200px;overflow:hidden;padding:6px 0;text-align:center;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);-transform:rotate(45deg);text-decoration:none;color:#fff;position:inherit;top:45px;right:-40px;border-width:1px 0;border-style:dotted;border-color:rgba(255, 255, 255, 0.7);font:700 13px &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;box-shadow:0 2px 3px 0 rgba(0, 0, 0, 0.5);background-color:#a00;" href="//github.com/doing-data-science/BinaryHeap.git">Fork me on Github</a></div>
15+
<div id="demonstrate">
16+
<canvas id="screen"></canvas>
17+
</div>
18+
<div id="docs"></div>
19+
<script src="page/javascript/index.js"></script>
20+
</body>
2121
</html>

lib/BinaryHeap.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
*/
8282
proto.add = function(object) {
8383
return this.insert(object);
84-
}
84+
};
8585

8686
/**
8787
* Clears all elements from queue.
@@ -90,15 +90,15 @@
9090
proto.clear = function() {
9191
this.list = [];
9292
return this;
93-
}
93+
};
9494

9595
/**
9696
* Returns the priority element. Same as peek().
9797
* @method get
9898
*/
9999
proto.get = function() {
100100
return this.peek();
101-
}
101+
};
102102

103103
/**
104104
* Inserts an element into queue.
@@ -115,7 +115,7 @@
115115
this.percolateUp(this.size() - 1);
116116
}
117117
return true;
118-
}
118+
};
119119
/**
120120
* Tests if queue is empty.
121121
* @method isEmpty
@@ -132,7 +132,7 @@
132132
*/
133133
proto.isFull = function() {
134134
return this.size() === this.capacity;
135-
}
135+
};
136136

137137
/**
138138
* Returns an iterator over this heap's elements.
@@ -142,15 +142,15 @@
142142
*/
143143
proto.iterator = function() {
144144
return this;
145-
}
145+
};
146146
/**
147147
* Returns the element on top of heap but don't remove it.
148148
* @method peek
149149
* @return {Object}
150150
*/
151151
proto.peek = function() {
152152
return this.isEmpty()? null: this.list[0];
153-
}
153+
};
154154

155155
/**
156156
* Returns the element on top of heap and remove it.
@@ -166,15 +166,15 @@
166166
this.percolateDown(0);
167167
}
168168
return heapTop;
169-
}
169+
};
170170

171171
/**
172172
* Removes the priority element. Same as pop().
173173
* @method remove
174174
*/
175175
proto.remove = function() {
176176
return this.pop();
177-
}
177+
};
178178

179179
/**
180180
* Returns the number of elements in this heap.
@@ -183,15 +183,15 @@
183183
*/
184184
proto.size = function() {
185185
return this.list.length;
186-
}
186+
};
187187
/**
188188
* Returns a string representation of this heap.
189189
* @method toString
190190
* @return {String}
191191
*/
192192
proto.toString = function() {
193193
return JSON.stringify(this.list);
194-
}
194+
};
195195

196196
/**
197197
* Tests if queue contains item.
@@ -200,16 +200,16 @@
200200
*/
201201
proto.contains = function(object) {
202202
return !!~this.list.indexOf(object);
203-
}
203+
};
204204

205205
/**
206206
* Increases the size of the heap to support additional elements
207207
* @method grow
208208
*/
209209
proto.grow = function() {
210-
this.capacity ++;
210+
this.capacity++;
211211
return this;
212-
}
212+
};
213213

214214
/**
215215
* Percolates element up heap from from the position given by the index.
@@ -236,7 +236,7 @@
236236
index = parentIndex;
237237
}
238238
return this;
239-
}
239+
};
240240

241241
/**
242242
* Percolates element down heap from the position given by the index.
@@ -271,7 +271,7 @@
271271
index = swap;
272272
}
273273
return this;
274-
}
274+
};
275275

276276
exports.Constructor = Constructor;
277277
exports.version = '0.1.0';

package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"repository": {
77
"type": "git",
8-
"url": "git://github.com/xudafeng/BinaryHeap.git"
8+
"url": "git://github.com/doing-data-science/BinaryHeap.git"
99
},
1010
"dependencies": {},
1111
"keywords": [
@@ -22,9 +22,5 @@
2222
"test": "mocha test/**/*.js",
2323
"test-travis": "node node_modules/.bin/istanbul cover node_modules/.bin/_mocha --report lcovonly -- -t 20000 test/*.test.js"
2424
},
25-
"homepage": "https://github.com/xudafeng/BinaryHeap",
26-
"author": "xudafeng",
27-
"email": "xudafeng[at]126.com",
28-
"blog": "http://xdf.me",
2925
"license": "MIT"
3026
}

0 commit comments

Comments
 (0)