Giter VIP home page Giter VIP logo

himanshugawari / ds-algo-js Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 41.42 MB

Data structures and Algorithms in Javascript

License: MIT License

JavaScript 99.31% HTML 0.69%
javascript data-structures algorithms algorithms-and-data-structures array dynamic-programming graph hashtable linked-list recursion bubble-sort insertion-sort selection-sort merge-sort quick-sort sorting-algorithms searching-algorithms dfs-algorithm bfs-algorithm

ds-algo-js's Introduction

DS-Algo-JS

Data structures and Algorithms in Javascript

Javascript Mind Map!

DS & Algo Mind Map!

Big O Cheat Sheet

-Big Os

  • O(1) Constant- no loops
  • O(log N) Logarithmic- usually searching algorithms have log n if they are sorted (Binary Search)
  • O(n) Linear- for loops, while loops through n items
  • O(n log(n)) Log Liniear- usually sorting operations
  • O(n^2) Quadratic- every element in a collection needs to be compared to ever other element. Two nested loops
  • O(2^n) Exponential- recursive algorithms that solves a problem of size N
  • O(n!) Factorial- you are adding a loop for every element
  • Iterating through half a collection is still O(n)
  • Two separate collections: O(a + b)
  • Two nested collections: O(a * b)

-What can cause time in a function?-

  • Operations (+, -, *, /)
  • Comparisons (<, >, ==)
  • Looping (for, while)
  • Outside Function call (function())

-Rule Book

  • Rule 1: Always worst Case
  • Rule 2: Remove Constants
  • Rule 3: Different inputs should have different variables. O(a+b). A and B arrays nested would be O(a*b).
  • Rule 4: Drop Non-dominant terms

-What causes Space complexity?-

  • Variables

  • Data Structures

  • Function Call

  • Allocations

  • Big-O Complexity Chart alt text

  • Common Data Structure Operations alt text

  • Array Sorting Algorithms alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

ds-algo-js's People

Contributors

himanshugawari avatar

Watchers

James Cloos 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.