{"_id":"binaryheapx","_rev":"93-9501baf54b796275a33ff1c09df375b6","name":"binaryheapx","description":"JavaScript Implementation of the Binary Heap.","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"binaryheapx","version":"0.1.0","description":"JavaScript Implementation of the Binary Heap.","bin":{"BinaryHeap":"./bin/BinaryHeap"},"main":"index.js","repository":{"type":"git","url":"git://github.com/xudafeng/BinaryHeap.git"},"dependencies":{},"keywords":["BinaryHeap","heap","sort"],"devDependencies":{"mocha":"*","should":"*"},"scripts":{"test":"mocha test/**/*.js"},"homepage":"https://github.com/xudafeng/BinaryHeap","author":{"name":"xudafeng"},"email":"xudafeng[at]126.com","blog":"http://xdf.me","license":"MIT","bugs":{"url":"https://github.com/xudafeng/BinaryHeap/issues"},"_id":"binaryheapx@0.1.0","_shasum":"73f411a0819d977e55b11f3784e8ea589fcc61c4","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"xudafeng","email":"xudafeng@126.com"},"maintainers":[{"name":"xudafeng","email":"xudafeng@126.com"}],"dist":{"shasum":"73f411a0819d977e55b11f3784e8ea589fcc61c4","tarball":"https://registry.npmjs.org/binaryheapx/-/binaryheapx-0.1.0.tgz","integrity":"sha512-SCVd2gdaitW/Kleu/59pBI/mT9Rnqfnxlm2Sk/fhypRR9zeDIpQAVurVbCwbwevRYNDMmMxq2DUw9IpoWmPxRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEDFRPGRW1Yfz0E8ygh3xlX7uJzfABEB/NRtxfthcQ6/AiEArvAXflzIDu2rnhLP2N3CeIXOoqJoJB5I3c9+/CAselk="}]},"directories":{}},"0.1.1":{"name":"binaryheapx","version":"0.1.1","description":"JavaScript Implementation of the Binary Heap.","bin":{"BinaryHeap":"./bin/BinaryHeap"},"main":"index.js","repository":{"type":"git","url":"git://github.com/xudafeng/BinaryHeap.git"},"dependencies":{},"keywords":["BinaryHeap","heap","sort"],"devDependencies":{"mocha":"*","should":"~4.0.4","istanbul":"*","should-http":"0.0.2"},"scripts":{"test":"mocha test/**/*.js","test-travis":"node node_modules/.bin/istanbul cover node_modules/.bin/_mocha --report lcovonly -- -t 20000 -r should-http test/*.test.js"},"homepage":"https://github.com/xudafeng/BinaryHeap","author":{"name":"xudafeng"},"email":"xudafeng[at]126.com","blog":"http://xdf.me","license":"MIT","bugs":{"url":"https://github.com/xudafeng/BinaryHeap/issues"},"_id":"binaryheapx@0.1.1","_shasum":"7edc1211937202a5bc191d7f8f62028f96aa7ff3","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"xudafeng","email":"xudafeng@126.com"},"maintainers":[{"name":"xudafeng","email":"xudafeng@126.com"}],"dist":{"shasum":"7edc1211937202a5bc191d7f8f62028f96aa7ff3","tarball":"https://registry.npmjs.org/binaryheapx/-/binaryheapx-0.1.1.tgz","integrity":"sha512-nY7WZDlpIOWghNXI4EjW5L31pgBJAvBLYR9fMdaFbPtX1nDviS4DCrHYji9B/MNWkZOh8ixfAVGyZKjCzu/Bww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDYaDt65aTL+5xEcY0U2d27fNzVcC8jkAq+4ZUXVpExAIhAKI2O6KTRVNbcchrbd+U8UaKIlVIfe5uDk/vWR05uYeh"}]},"directories":{}}},"readme":"# Class BinaryHeap\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![node version][node-image]][node-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/binaryheapx.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/binaryheapx\n[travis-image]: https://img.shields.io/travis/xudafeng/BinaryHeap.svg?style=flat-square\n[travis-url]: https://travis-ci.org/xudafeng/BinaryHeap\n[coveralls-image]: https://img.shields.io/coveralls/xudafeng/BinaryHeap.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/xudafeng/BinaryHeap?branch=master\n[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square\n[node-url]: http://nodejs.org/download/\n[download-image]: https://img.shields.io/npm/dm/binaryheapx.svg?style=flat-square\n[download-url]: https://npmjs.org/package/binaryheapx\n\n> JavaScript Implementation of the Binary Heap.\n\n## Constructor Detail\n\n### BinaryHeap()\n\nConstructs a new minimum binary heap, Minimum heap is default;\n\n### BinaryHeap(Boolean isMinHeap)\n\nConstructs a new minimum binary heap.\n\n` Parameters: `\n\n* isMinHeap - true to use the order imposed by the given comparator; false to reverse that order\n\n### BinaryHeap(Function comparator)\n\nConstructs a new BinaryHeap that will use the given comparator to order its elements.\n\n` Parameters: `\n\n* capacity - the initial capacity for the heap\n\n### BinaryHeap(Number capacity)\n\nConstructs a new minimum binary heap with the specified initial capacity.\n\n` Parameters: `\n\n* capacity - The initial capacity for the heap. This value must be greater than zero.\n\n` Throws: `\n\n* IllegalArgumentException - if capacity is <= 0\n\n### BinaryHeap(Number capacity, Boolean isMinHeap, Function comparator)\n\nConstructs a new BinaryHeap.\n\n` Parameters: `\n\n* capacity - the initial capacity for the heap\n* isMinHeap - true to use the order imposed by the given comparator; false to reverse that order\n* comparator - the comparator used to order the elements, null means use natural order\n\n` Throws: `\n\n* IllegalArgumentException - if capacity is <= 0\n\n\n## Method Detail\n\n### void clear()\n\nClears all elements from queue.\n\n### boolean isEmpty()\n\nTests if queue is empty.\n\n` Returns: `\n\n* true if queue is empty; false otherwise.\n\n### boolean isFull()\n\nTests if queue is full.\n\n` Returns: ` \n\n* true if queue is full; false otherwise.\n\n### void insert(Object element)\n\nInserts an element into queue.\n\n` Parameters: `\n\n* element - the element to be inserted\n\n### object peek()\n\nReturns the element on top of heap but don't remove it.\n\n` Returns: ` \n\n* the element at top of heap\n\n` Throws: ` \n\n* NoSuchElementException - if isEmpty() == true\n\n### object pop()\n\nReturns the element on top of heap and remove it.\n\n` Returns: `\n\n* the element at top of heap\n\n` Throws: `\n\n* NoSuchElementException - if isEmpty() == true\n\n\n### string toString()\n\nReturns a string representation of this heap.\n\n` Returns: `\n\n* a string representation of this heap\n\n### object iterator()\n\nReturns an iterator over this heap's elements.\n\n` Returns: `\n\n* an iterator over this heap's elements\n\n### boolean add(Object object)\n\nAdds an object to this heap. Same as insert(Object).\n\n` Parameters: `\n\n* object - the object to add\n\n` Returns: `\n\n* true, always\n\n### object get()\n\nReturns the priority element. Same as peek().\n\n` Returns: `\n\n* the priority element\n\n` Throws: `\n\n* BufferUnderflowException - if this heap is empty\n\n### object remove()\n\nRemoves the priority element. Same as pop().\n\n` Returns: `\n\n* the removed priority element\n\n` Throws: `\n\n* BufferUnderflowException - if this heap is empty\n\n### number size()\n\nReturns the number of elements in this heap.\n\n` Returns: `\n\n* the number of elements in this heap\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 xdf\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"email":"npm@npmjs.com","name":"npm"}],"time":{"modified":"2023-02-13T10:42:15.718Z","created":"2014-08-26T17:20:30.033Z","0.1.0":"2014-08-26T17:20:30.033Z","0.1.1":"2014-09-17T16:06:25.832Z"},"homepage":"https://github.com/xudafeng/BinaryHeap","keywords":["BinaryHeap","heap","sort"],"repository":{"type":"git","url":"git://github.com/xudafeng/BinaryHeap.git"},"author":{"name":"xudafeng"},"bugs":{"url":"https://github.com/xudafeng/BinaryHeap/issues"},"license":"MIT","readmeFilename":"README.md","users":{"xudafeng":true}}