All Projects → akhenda → es6-data-structures-and-algorithms

akhenda / es6-data-structures-and-algorithms

Licence: MIT license
This repository contains some popular Data Structures and Algorithms done in JavaScript, ES6.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to es6-data-structures-and-algorithms

competitive programming codebook
Programming Contest Book.
Stars: ✭ 76 (+111.11%)
Mutual labels:  algorithms-and-data-structures
OI-Template
Bill Yang's algorithm & data structure templates
Stars: ✭ 15 (-58.33%)
Mutual labels:  algorithms-and-data-structures
algo-drills
A command line tool for memorizing algorithms in Python by typing them.
Stars: ✭ 42 (+16.67%)
Mutual labels:  algorithms-and-data-structures
DataStructures-Algorithms
A collections of many CP-based or DSA-based Questions that is stored various algorithms and datastructures to increase coding aptitutde. Anybody with a knack for coding can feel free to add more solutions and questions in the respective folders
Stars: ✭ 15 (-58.33%)
Mutual labels:  algorithms-and-data-structures
Algorithms-Open-Source
We have a task for each skill level!!
Stars: ✭ 31 (-13.89%)
Mutual labels:  algorithms-and-data-structures
CPTH
🌟 Competitive Programming Template Headers | With documentation, CI tests and Codecov
Stars: ✭ 23 (-36.11%)
Mutual labels:  algorithms-and-data-structures
shortest-path-finder
Shortest Path Finder visualizer using Breadth First Search algorithm
Stars: ✭ 195 (+441.67%)
Mutual labels:  algorithms-and-data-structures
FAANG-Coding-Interview-Questions
A curated List of Coding Questions Asked in FAANG Interviews
Stars: ✭ 1,195 (+3219.44%)
Mutual labels:  algorithms-and-data-structures
Algorithm-in-JavaScript
Implementing all-time classic algorithmic problems in JS
Stars: ✭ 20 (-44.44%)
Mutual labels:  algorithms-and-data-structures
coding-for-algorithms
数据结构,剑指offer,leetcode等OJ平台刷题记录(C++/Python/Java)
Stars: ✭ 20 (-44.44%)
Mutual labels:  algorithms-and-data-structures
python-data-structures-and-algorithms
No description or website provided.
Stars: ✭ 57 (+58.33%)
Mutual labels:  algorithms-and-data-structures
AlgorithmsAndDataStructure
Algorithms And DataStructure Implemented In Python, Java & CPP, Give a Star 🌟If it helps you
Stars: ✭ 724 (+1911.11%)
Mutual labels:  algorithms-and-data-structures
timetable-scheduler
⏲ An Activity Scheduling Project of Algorithms Analysis to schedule the timetable for Educational Institutes.
Stars: ✭ 26 (-27.78%)
Mutual labels:  algorithms-and-data-structures
AlmanaqueBrute
Repositório para códigos de competição
Stars: ✭ 22 (-38.89%)
Mutual labels:  algorithms-and-data-structures
ds-algo
Implementation of common Data Structures and Algorithms with Go
Stars: ✭ 177 (+391.67%)
Mutual labels:  algorithms-and-data-structures
LeetCode
200 LeetCode practice problems for beginners in algorithms and data structures
Stars: ✭ 120 (+233.33%)
Mutual labels:  algorithms-and-data-structures
ctl
My variant of the C Template Library
Stars: ✭ 105 (+191.67%)
Mutual labels:  algorithms-and-data-structures
LearnCPP
Learn Cpp from Beginner to Advanced ✅ Practice 🎯 Code 💻 Repeat 🔁 One step solution for c++ beginners and cp enthusiasts.
Stars: ✭ 359 (+897.22%)
Mutual labels:  algorithms-and-data-structures
Awesome-Software-Engineering-Interview
No description or website provided.
Stars: ✭ 409 (+1036.11%)
Mutual labels:  algorithms-and-data-structures
Harris-Hawks-Optimization-Algorithm-and-Applications
Source codes for HHO paper: Harris hawks optimization: Algorithm and applications: https://www.sciencedirect.com/science/article/pii/S0167739X18313530. In this paper, a novel population-based, nature-inspired optimization paradigm is proposed, which is called Harris Hawks Optimizer (HHO).
Stars: ✭ 31 (-13.89%)
Mutual labels:  algorithms-and-data-structures

EcmaScript 6 Algorithms and Data Structures

Build Status codecov Codacy Badge Codacy Badge license Commitizen friendly semantic-release

This repository contains some popular Data Structures and Algorithms done in JavaScript ES6.

Data Structures

According to Wikipedia:

In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.

The following terms are the foundation terms of a data structure.

  • Interface - This represents the set of operation supported by a data structure
  • Implementation - This provides the definition of algorithms used in the operations of the data structure i.e. it provides the internal representation of the data structure

Characteristics of a Data Structure

  1. Correctness - a data structure should implement its interface correctly
  2. Time Complexity - execution time of operations of a data structure should be as small as possible
  3. Space Complexity - memory usage of a data structure operation should be as little as possible

Data Structure Operations Complexity

Data Structure Access Search Insertion Deletion
Array 1 n n n
Stack n n 1 1
Queue n n 1 1
Linked List n n 1 1
Hash Table - n n n
Binary Search Tree n n n n
B-Tree log(n) log(n) log(n) log(n)
AVL Tree log(n) log(n) log(n) log(n)

DS Operations

Shown below are the data structures covered here:

Algorithms

This is a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.

The following are the algorithms covered here:

Algorithms by Topic

Algorithms by Paradigm

An algorithmic paradigm is a generic method or approach which underlies the design of a class of algorithms. It is an abstraction higher than the notion of an algorithm, just as an algorithm is an abstraction higher than a computer program.

Array Sorting Algorithms Complexity

Name Best Average Worst Memory Stable
Bubble sort n n2 n2 1 Yes
Insertion sort n n2 n2 1 Yes
Selection sort n2 n2 n2 1 No
Heap sort n log(n) n log(n) n log(n) 1 No
Merge sort n log(n) n log(n) n log(n) n Yes
Quick sort n log(n) n log(n) n2 log(n) No
Shell sort n log(n) depends on gap sequence n (log(n))2 1 No
Counting sort n + r n + r n + r n + r Yes
Radix sort n * k n * k n * k n + k Yes

Big-O Notation

This is a theoretical measure of the execution of an algorithm, usually the time or memory needed, given the problem size n, which is usually the number of items. Informally, saying some equation f(n) = O(g(n)) means it is less than some constant multiple of g(n).

It is used in Computer Science to describe the performance or complexity of an algorithm. Big-O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm.

The most optimum algorithm scales in constant time and space. This means it does not care at all about the growth of its inputs. Next best is logarithmic time or space, then linear, linearithmic, quadratic, and exponential. The worst is factorial time or space. In Big-O notation:

  1. Constant: O(1)
  2. Logarithmic: O(log n)
  3. Linear: O(n)
  4. Linearithmic: O(n log n)
  5. Quadratic: O(n²)
  6. Expontential: O(2^n)
  7. Factorial: O(n!)

Below is the list of some of the most used Big O notations and their performance comparisons against different sizes of the input data.

Big O Notation Computations for 10 elements Computations for 100 elements Computations for 1000 elements
O(1) 1 1 1
O(log N) 3 6 9
O(N) 10 100 1000
O(N log N) 30 600 9000
O(N^2) 100 10000 1000000
O(2^N) 1024 1.26e+29 1.07e+301
O(N!) 3628800 9.3e+157 4.02e+2567

Installation

Clone this repo:

$ git clone https://github.com/akhenda/es6-data-structures-and-algorithms.git

Navigate to the es6-data-structures-and-algorithms directory:

$ cd es6-data-structures-and-algorithms

Install the required dependencies:

$ yarn install

Testing

To run both tests and linting, run:

yarn run validate

To run the tests alone:

yarn run test

To run ESLint:

yarn run lint

Usage

...

Resources

License

The MIT License (MIT)

Copyright (c) 2016 Joseph Akhenda.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].