https://github.com/thangved/stack-structure
A stack library
https://github.com/thangved/stack-structure
datastructure js stack
Last synced: 24 days ago
JSON representation
A stack library
- Host: GitHub
- URL: https://github.com/thangved/stack-structure
- Owner: thangved
- License: mit
- Created: 2022-01-25T09:11:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-28T00:55:37.000Z (about 4 years ago)
- Last Synced: 2025-10-10T04:52:59.755Z (6 months ago)
- Topics: datastructure, js, stack
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# stack-structure
A stack library
## Usage
```js
import Stack from "stack-structure";
const stack = new Stack();
```
## Methods
| Name | Params | Return value |
| ----------- | ----------- | ------------------------------------ |
| top() | No params | `any`: element of top index |
| empty() | No params | `boolean`: check empty stack |
| push(x:any) | x: `number` | `void`: add `x` element to top stack |
| pop() | No params | `void`: remove top element of stack |
## Donation