Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flex-algo

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flex-algo - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

1

lib/binaryTree.d.ts

@@ -11,3 +11,4 @@ declare class BinaryNode {

insert(data: (number | null)[]): BinaryNode | null | undefined;
levelOrder(): (number | undefined)[][];
}
export {};

@@ -54,4 +54,27 @@ "use strict";

};
BinaryTree.prototype.levelOrder = function () {
var queue = [];
var levels = [];
queue.push(this.root);
while (queue.length) {
var level = [];
var levelSize = queue.length;
var count = 0;
while (count < levelSize) {
var current = queue.shift();
count += 1;
level.push(current === null || current === void 0 ? void 0 : current.value);
if (current === null || current === void 0 ? void 0 : current.left) {
queue.push(current.left);
}
if (current === null || current === void 0 ? void 0 : current.right) {
queue.push(current.right);
}
}
levels.push(level);
}
return levels;
};
return BinaryTree;
}());
exports.BinaryTree = BinaryTree;

2

package.json
{
"name": "flex-algo",
"version": "0.1.2",
"version": "0.1.3",
"description": "\"SDK for commonly used data structure and algorithms\"",

@@ -5,0 +5,0 @@ "main": "lib/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