Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@raikuxq/alg-ds
Advanced tools
Documentation app: [raikuxq-algorithms.netlify.app/guide](https://raikuxq-algorithms.netlify.app/guide)
Common algorithms and data structures.
Written in TypeScript, tested with Jest.
Documentation app: raikuxq-algorithms.netlify.app/guide
Install by using any of these commands:
yarn add @raikuxq/alg-ds
npm install @raikuxq/alg-ds --save
Clone this repository and install dependencies by using yarn
command.
yarn test
- run all tests via jestyarn dev
- run in dev mode via nodemon (src/index.ts is an entrypoint)yarn build
- compile ts sources into js filesyarn start
- build and run in production modeyarn lint
- lint check via eslintyarn lint:fix
- fix source files via eslintmemoize — Memoization util function.
binary-search [ tests ] — Binary searching algorithm. Time: O(log(n)).
factorial [ tests ] — Recursive O(n!) and memoized O(n) factorial implementation.
fibonacci [ tests ] — Recursive O(n!) and memoized O(n) factorial implementation.
transpose-matrix [ tests ] — Transpose N*N matrix util function.
bubble-sort [ tests ] — Time: O(n^2) worst, O(n^2) avg, O(n) best. Memory: O(1) worst.
selection-sort [ tests ] — Time: O(n^2) worst, O(n^2) avg, O(n^2) best. Memory: O(1) worst.
insertion-sort [ tests ] — Time: O(n^2) worst, O(n^2) avg, O(n) best. Memory: O(1) worst.
merge-sort [ tests ] — Time: O(nlog(n)) worst, O(nlog(n)) avg, O(n*log(n)) best. Memory: O(n) worst.
quick-sort [ tests ] — Time: O(n^2) worst, O(nlog(n)) avg, O(nlog(n)) best. Memory: O(1) worst.
ILinearStorage — Contains common methods of linear data structures.
ILinearStorageRA — Allows random access (from end, from start, by index). Extends ILinearStorage interface.
IConvertableToArray — Contain methods for converting from/into array.
ILinkedList — Contains basic linked lists operations. Extends ILinearStorageRA and IConvertableToArray interface.
AbstractLinkedList — Common logic for both single and double linked lists. Implements ILinearStorageRA interface.
SingleLinkedList [ tests ] — Extends abstract linked list with implementation of one-way linking.
DoubleLinkedList [ tests ] — Extends abstract linked list with implementation of two-way linking.
IterableSingleLinkedList [ tests ] — Extends single linked list with iterator implementation. Implements IIterable interface.
IterableDoubleLinkedList [ tests ] — Extends double linked list with implementation of two-way linking. Implements IBiDirectIterable interface.
IArrayFacade — Contains basic array operations. Extends ILinearStorageRA interface. Extends IConvertableToArray interface.
LoopedArray [ tests ] — Overwrites data on capacity overflow.
Stack [ tests ] — LIFO data structure. Implements ILinearStorage interface.
Queue [ tests ] — FIFO data structure. Implements ILinearStorage interface.
IKeyValueStorage — Contains basic key-value storages operations.
HashTableNode — Contains key, data and isDeleted properties.
HashTable [ tests ] — Implementation of open addressing hash table using quadratic probing
IGraph — Contains basic graph operations.
IGraphIterator — Extends default iterator with init and getPath methods.
IGraphIterationStrategy — Iteration strategies which are used in shortest-path, has-path.
GraphEdge — Contains from/to links and edge weight.
AbstractGraph — Common logic for both directed and undirected graphs.
DirectedGraph [ tests ] — In case of directed graph A->B and B->A edges are not the same.
UndirectedGraph [ tests ] — In case of undirected graph A->B and B->A are equal.
BreadthFirstSearchIterator — Traversal method for unweighted graphs, built on queue.
DepthFirstSearchIterator — Traversal method for unweighted graphs, built on stack.
DijkstraMethodIterator — Traversal method for weighted graphs, built on finding the minimal cost.
presenter-adjacency-lists [ tests ] — Representation of graph as an adjacency list (using Map).
presenter-adjacency-matrix [ tests ] — Representation of graph as an adjacency matrix (using Array N*N).
has-path (BFS/DFS) [ tests ] — Search for the existence of a path between two vertices.
shortest-path (BFS/Dijkstra) [ tests ] — Search for one of several shortest paths between two vertices.
create-graph-from-matrix [ tests ] — Convert a matrix N*N into a graph instance.
transpose-directed-graph [ tests ] — Transpose a directed graph (undirected graphs are symmetrical already).
IBinaryTree — Contains basic binary tree operations.
AbstractBinaryNode — Contains left/right/parent links and node data.
AbstractBinaryTree — Common logic for all types of binary trees.
BinarySearchNode — Same as abstract binary node.
BinarySearchTree — Implementation of unbalanced binary search tree. Each node in left subtree is smaller and each node in right subtree is larger than the node data. Extends AbstractSearchTree.
RandBinarySearchNode — Have a rank attribute. Extends BinarySearchNode.
RandBinarySearchTree — Implementation of randomized binary search tree, which gives expected log(N) height. INSERTION have a 1/N+1 probability of inserting into root. Extends BinarySearchTree.
FAQs
Documentation app: [raikuxq-algorithms.netlify.app/guide](https://raikuxq-algorithms.netlify.app/guide)
We found that @raikuxq/alg-ds 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.