Data structures implementations:
- Stack
- Queue
These instructions will get you setup to use data-structs
in your project.
using NPM | using Yarn | |
---|---|---|
Installation | npm i -D @swiftx/data-structs typescript |
yarn add -D @swiftx/data-structs typescript |
import {Stack} from './stack';
const stack = new Stack<string>(4);
stack.push('one');
stack.push('two');
stack.push('three');
stack.push('four');
stack.push('five'); // Throws error, capacity is 4
stack.size(); // Output: 4
stack.peek(); // Output: "four"
stack.size(); // Output: 4
stack.pop(); // Output: "four"
stack.size(); // Output: 3
- Klyuchevskiy Valeriy - vklyuche
This project is licensed under the MIT License - see the LICENSE file for details