Skip to content

Commit 81ee9cd

Browse files
author
Patrick Chan
committed
Updated README.md
1 parent e030c44 commit 81ee9cd

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<p align="center"><a href="https://github.com/sakura90/sorted-array-operations"><img src="https://sakura90.github.io/moduleLogo.png" height="60"/></a></p>
1+
<p align="center"><a href="https://github.com/sakura90/sorted-array-operations"><img src="https://sakura90.github.io/moduleLogo.png" height="180"/></a></p>
22
<h1 align="center">Sorted Array Operations</h1>
33
<p align="center">Sorted array operation module that has a broad operation coverage.</p>
44

55
<p align="center">
66
<a href="#"><img src="https://img.shields.io/badge/Unit%20test-passing-brightgreen" height="20"/></a>
7-
<a href="#"><img src="https://sakura90.github.io/Size-2.9kB-green" height="20"/></a>
8-
<a href="https://twitter.com/intent/tweet?text=Sorted%20array%20operation%20JavaScript%20module&url=https://github.com/sakura90/sorted-array-operations&hashtags=javascript,opensource,js,webdev,developers"><img src="http://randojs.com/images/tweetShield.svg" alt="Tweet" height="20"/></a>
7+
<a href="#"><img src="https://img.shields.io/badge/Size-2.9kB-green" height="20"/></a>
98
<a href="#"><img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" height="20"/></a>
9+
<a href="https://twitter.com/intent/tweet?text=Sorted%20array%20operation%20JavaScript%20module&url=https://github.com/sakura90/sorted-array-operations&hashtags=javascript,opensource,js,webdev,developers"><img src="http://randojs.com/images/tweetShield.svg" alt="Tweet" height="20"/></a>
1010
</p><br/><br/>
1111

12-
<p align="center"><img src="https://sakura90.github.io/sorted-array-operations-demo-use.gif" width="100%"/></p><br/>
12+
<p align="center"><img src="https://sakura90.github.io/sorted-array-operations-demo-use.gif" width="50%"/></p><br/>
1313

1414
## Overview
1515
Existing libraries cover non-standard operations or cover the operations partially on sorted arrays.
@@ -39,6 +39,7 @@ CDN
3939
```js
4040
const ops = require('sorted-array-operations');
4141

42+
console.log(ops.union([2, 3, 5, 6], [2, 6, 8])); // [ 2, 3, 5, 6, 8 ]
4243
console.log(ops.intersection([2, 3, 5, 6], [2, 6, 8])); // [ 2 ]
4344
console.log(ops.difference([2, 3, 5, 6], [2, 6, 8])); // [ 3, 5 ]
4445
console.log(ops.symmetric_difference([2, 3, 5, 6], [2, 6, 8])); // [ 3, 5, 8 ]
@@ -63,6 +64,7 @@ function weight_cmp(p1, p2) {
6364
return p1.weight > p2.weight ? 1 : p1.weight < p2.weight ? -1 : 0;
6465
}
6566

67+
console.log(ops.union([{weight: 2}, {weight: 3}], [{weight: 3}], weight_cmp)); // [ {weight: 2}, {weight: 3} ]
6668
console.log(ops.intersection([{weight: 2}, {weight: 3}], [{weight: 3}], weight_cmp)); // [ {weight: 3} ]
6769
console.log(ops.difference([{weight: 2}, {weight: 3}], [{weight: 3}], weight_cmp)); // [ {weight: 2} ]
6870
console.log(ops.symmetric_difference([{weight: 2}, {weight: 3}], [{weight: 3},{weight: 4}], weight_cmp)); // [ {weight: 2}, {weight: 4} ]
@@ -86,9 +88,10 @@ console.log(ops.equal_range([{weight: 2}, {weight: 3}], {weight: 2}, weight_cmp)
8688

8789
## Related libraries
8890
The library most similar to this library is [sorted-array-functions](https://www.npmjs.com/package/sorted-array-functions).
89-
This library has the set operations on sorted arrays and follows the way of implementing lower_bound and upper_bound
90-
in the standard libraries in C++ and Python. These 2 differences are the major differences between this library and sorted-array-functions.
91+
This library has the set operations on sorted arrays and follows the way of implementing `lower_bound` and `upper_bound`
92+
in the standard libraries in C++ and Python. These 2 differences are the major differences between this library and
93+
[sorted-array-functions](https://www.npmjs.com/package/sorted-array-functions).
9194
Other related libraries can be found in Google.
9295

9396
## Contributing
94-
The sorted array operation library welcomes patches/pulls for features and bugfixes. Please open an issue and send a PR request!
97+
The sorted array operation library welcomes patches/pulls for features and bug fixes. Please open an issue and send a PR request!

0 commit comments

Comments
 (0)