Giter VIP home page Giter VIP logo

julia-dizhak / javascript-algorithms Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 3.43 MB

Collection of classic computer science paradigms, algorithms, and approaches written in JavaScript, demo is

Home Page: https://julia-dizhak.github.io/javascript-algorithms/

HTML 0.06% CSS 0.40% JavaScript 99.54%
javascript-algorithms computer-science-algorithms jest algorithm computer-science sorting-algorithms-implemented string-manipulation react github-page binary-search-tree

javascript-algorithms's Introduction

Computer Science in JavaScript

The repo contains JavaScript implementations of different famous computer science algorithms.

As well below you will find solution for leetcode problems divided by dependency of topic relation.

Description

Collection of classic computer science paradigms, algorithms, and approaches written in JavaScript. As well contains description and characteristics: runtime or complexity. Without using in-built methods of JavaScript, for example, sort(), reverse() and etc. Solutions include as well measuring of time complexity.

Demo

Hosted on GitHub Pages, Demo

Development

Technology ES6, Yarn, Babel, Jest with a syntax highlighter Highlightjs.

Tests run by npm test

This project was bootstrapped with Create React App

Author

by Yuliia (Julia) Dizhak started on 12/21/17

Complexity terms

Symbol Name Performance
Ω big-omega best-case performance
θ big-theta average
O big-oh worst

Main Data Structures implementations by Javascript

  • Strings manipulation

    Complexity: Time Space
    iterative, 2 loops O(n^2) 0(?)
  • Array

    • Array built-in methods
    Complexity: Time Space
    push O(1) 0(1)
    pop O(1) 0(1)
    shift O(n) 0(1)
    unshift O(n) 0(1)
    delete O(n) 0(1)
    reverse, splice, slice, concat O(n) 0(1)
  • Linked Lists

    Complexity: Time Space
    get(index) O(n) 0(1)
    addAtHead(val) O(1) 0(1)
    addAtTail(val) O(n) 0(1)
    addAtIndex(index, val) O(n) 0(1)
    deleteAtIndex(index) O(n) 0(1)
  • Stack implementation

    Complexity: Time Space
    All operations O(1) 0(N)?
  • Queue implementation

    Complexity Time: enqueue dequeue
    1 Pointer (head) O(n) 0(1)
    2 Pointers (head and tail) O(1) 0(1)
  • Hash implementation

    Complexity: time space
    add O(1) 0(1)
    remove O(1) 0(1)
    contains O(1) 0(1)
  • Binary Tree (BT)

    Complexity: Time Space
    insert iterative + Queue O(log n) 0(1)
    insert(node) recursion O(?) 0(?)
    ...
  • Binary Tree Traversal

    Approaches: Time Space
    DFS+ Stack O(n) 0(h)
    Recursion O(n) 0(n)
    Approaches: Time Space
    Iterative + Queue O(n) 0(n/2 = n)
    Approaches: Time Space
    BFS + Queue O(n) 0(n)
    Recursion O(n) 0(n)
  • Binary Search Tree (BST) Implementation

    Complexity: Time Space
    Insert Recursive / iterative O(log n) 0(n) / O(1)
    ...
  • Heap

    Complexity: Time Space
    insert(val) O(log n) 0(1)
    deleteMax O(log n) O(1)
    max O(1) O(1)

Bitwise operator in JS

Searching and Sorting

Problem solving on leetcode

Programming methods/paradigms

OOP in JS

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

Folder structure

The most recent packages are found in these directories:

  • src/ds - the implementation source code
  • src/ds/***.spec.js - tests for the implementation source code

TODO:

  • scrollTo works with bug
  • details toggle works with bug (sometimes)
  • display level: beginner, medium, ... (like corners)
  • generate test coverage
  • performance test
  • seo

javascript-algorithms's People

Contributors

julia-dizhak avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.