Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jalalazimi/algorz

Data Structures & Algorithms for Javascript
https://github.com/jalalazimi/algorz

algorithm data-structures

Last synced: about 12 hours ago
JSON representation

Data Structures & Algorithms for Javascript

Awesome Lists containing this project

README

        

# Algorz
Data Structures & Algorithms for Javascript

## Getting started

#### Yarn (or NPM)

Install with npm :
```bash
npm install algorz --save
```
Install with yarn:
```bash
yarn add algorz
```

Basic usage example below. _Note: it does not cover all the available
methods, rather just highlights the main functionality to get up and running
with this data structure. For a description of all the methods, see the
API section._

```javascript

import {Dictionry} from algorz;

lib = new Dictionary();
lib.add('Raymond', '123');
lib.add('David', '345');
lib.add('Cynthia', '456');

```

## API

## List
* ### listSize (property)
Number of elements in list
* ### pos (property)
Current position in list
* ### length (property)
Returns the number of elements in list
* ### clear (function)
Clears all elements from list
* ### toString (function)
Returns string representation of list
* ### getElement(function)
Returns element at current position
* ### insert (function)
Inserts new element after existing element
* ### append (function)
Adds new element to end of list
* ### remove (function)
Removes element from list
* ### front (function)
Sets current position to first element of list
* ### end (function)
Sets current position to last element of list
* ### prev (function)
Moves current position back one element
* ### next (function)
Moves current position forward one element
* ### currPos (function)
Returns the current position in list
* ### moveTo (function)
Moves the current position to specified position