
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@tomasperezv/data-structures
Advanced tools
Data structures and Algorithms implemented in Javascript.
Tomas Perez - tom@0x101.com
$ npm install
If you want to run the tests, you need to install mocha globally:
$ npm install -g mocha
Then you can run the tests:
$ npm test
BinaryOperator
getBit
✓ Returning bits
setBit
✓ Setting bits
clearBit
✓ Clearing bits
Insertion sort
✓ Trivial cases
✓ Non trivial cases
Merge sort
✓ Already sorted array
✓ Non trivial cases
Quick sort
✓ Partition method
✓ Already sorted array
✓ Non trivial cases
Two Sum
✓ Basic tests
BFS
Solve algorithm
✓ BFS simple search
Closest leaf
Solve algorithm
✓ Determine the closest leaf in a binary tree
DFS
Solve algorithm
✓ DFS simple search, iterative version
✓ DFS simple search, recursive version
Dijkstra
Error handling
✓ Empty graph
Solve algorithm
✓ Single source path search: one vertex
✓ Single source path search: multiple nodes
LargestCommonSubstring
The algorithm works as expected
✓ Basic cases
LargestOfTwoNumbers
The algorithm works as expected
✓ Basic cases
Min Height in binary trees
Solve
✓ Empty BinaryTrees
✓ Basic cases
SortedArrayToBST
The algorithm works as expected
✓ Basic cases
✓ Edge cases
TreeTraverse
In Order
✓ Traverses properly a binary tree in-order
✓ Traverses properly a binary tree post-order
✓ Traverses properly a binary tree in-order
BinaryTree
Creation
✓ Empty BinarySearchTree
✓ Simple BinarySearchTree
Inserting elements in a Binary Search Tree
✓ Basic insertion
Get largest element in a Binary Search Tree
✓ Construct the BST and search for the largest
BinaryTree
Creation
✓ Empty BinaryTrees
✓ Leave values must be BinaryTreeNode
✓ Simple creation
DoubleLinkedList
Insertion
✓ Simple insertion
✓ Can not insert an invalid a value
✓ Can insert multiples values
HashTable
The data structure works as expected
✓ Keys validation
✓ Insertion
✓ Hash function
List
isEmpty
✓ Checking if a list is empty
Insertion
✓ Simple insertion
✓ Can not insert an invalid a value
✓ Can insert multiples values
MinHeap
The data structure works as expected
✓ Basic cases
Node
Creation and initialization
✓ Simple creation
✓ Can not initialize a node without a value
Handling previous node
✓ Can assign a value to the previous node
✓ Can not assign invalid values to the previous node
Handling next node
✓ Can assign a value to the next node
✓ Can not assign invalid values to the next node
SuffixTree
Inserting words in a suffix tree
✓ Simple insertion and retrieval
Application of a suffix tree for computing common substrings
✓ Is q a substring of S
✓ How many times does q appear in S
✓ Longest common substring of S and q
Tree
Creation
✓ Empty trees
✓ isLeaf
✓ Leave values must be TreeNode
✓ Simple creation
Trie
Inserting and retrieval
✓ Simple insertion and retrieval of words
60 passing (98ms)
Public Domain.
No warranty expressed or implied. Use at your own risk.
FAQs
Experiments with data structures.
We found that @tomasperezv/data-structures demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.