ds4js

NPM package for data structure

Usage no npm install needed!

<script type="module">
  import ds4js from 'https://cdn.skypack.dev/ds4js';
</script>

README

ds4js

NPM package for data structure

command to Install :

npm install ds4js --save

Data Structure:

  • Stack

Example:

const dataStructure = require('ds4js');

var stack = dataStructure.stack();

stack.push("hello");
var element = stack.peek(); // hello
var length = stack.length(); // 1
var isEmpty = stack.isEmpty(); // false
var element = stack.pop(); // hello
var length = stack.length(); // 0
var isEmpty = stack.isEmpty(); // true