New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

data-structure-for-js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-structure-for-js - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

13

heap.js

@@ -5,5 +5,6 @@ var _elements = []

function _heapAdjust(elements, pos, len) {
pos = parseInt(pos)
var swap = elements[pos];
var child = pos * 2 + 1;
while (child - len) {
while (child < len) {
if (child + 1 < len && (elements[child] - elements[child + 1]) * _isMax < 0) {

@@ -48,4 +49,7 @@ child += 1;

var top = this.top()
_elements[0] = _elements.pop()
_heapAdjust(_elements, 0, _elements.length)
var tail = _elements.pop()
if(_elements.length)
_elements[0] = tail
if( _elements.length > 1)
_heapAdjust(_elements, 0, _elements.length)
return top

@@ -58,2 +62,5 @@ }

}
Heap.prototype.empty = function(){
return !_elements.length;
}
Heap.prototype.getHeapArr = function() {

@@ -60,0 +67,0 @@ return _elements

{
"name": "data-structure-for-js",
"version": "1.0.0",
"version": "1.0.1",
"description": "Normal data structures for javascript",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc