Code Monkey home page Code Monkey logo

algorithms's Introduction

Algorithms


Algorithms

A collection of coding challenge/interview problems solved in JavaScript. Oftentimes a single file will declare the same function more than once (e.g. ./freeCodeCamp/fibonacci.js); each subsequent definition is generally a more efficient version than what precedes it.

Also: solutions to (eventually) all exercises in Eloquent JavaScript.

Big Theta partial list of common functions in asymptotic notation, listed from slowest to fastest growing:

  1. Θ(1)
  2. Θ(lg n)
  3. Θ(n)
  4. Θ(n lg n)
  5. Θ(n²)
  6. Θ(n²​​ lg n)
  7. Θ(n³)
  8. Θ(2^n)

###Constant Growth

A function has constant growth if its output does not change based on the input, n.

###Logarithmic Growth

###Linear Growth

A function has linear growth if its output increases linearly with the size of its input. If n is never raised to a power greater than 1 or used as a power, it is linear, e.g. 3n.

###Linearithmic Growth

A function is linearithmic if we multiply linear terms by a logarithm, they take the form: n logK n. With n being equal in both, then the growth is dependent on the base k of the logarithms. Lesser bases grow more quickly than higher bases, so e.g. n log2 n will grow more quickly than n log6 n

###Polynomial Growth

A function has polynomial growth if its output increases according to a polynomial expression. The way to identify polynomial functions is to find those where n is raised to a constant power, e.g. 2n³ or 3n³.

###Exponential Growth

A function has exponential growth if its output increases according to an exponential expression. The way to identify exponential funcitons is to find those where a constant is raised to some expression involving n, e.g. 2^n or (3/2)^n.

###Debugger Steps:

  • add a debugger statement in a function
  • call the function manually
  • $ node inspect index.js
  • to continue execution of file, press 'c' then 'enter'
  • to launch a repl session, type 'repl' then 'enter'
  • to exit the repl, press Ctrl + C

algorithms's People

Contributors

hectorcoronado 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.