Giter Site home page Giter Site logo

competitve-javascript's Introduction

Competitve Programming

Competitive Programming is competing with other programmers while solving problems that require algorithm,math and clever language usage.

Why JavaScript?

JavaScript is one of the most popular programming languages in the world, but still it is one of the most ignored languages when it comes to competitive programming. This is mainly because of the fact that JavaScript lacks in certain areas that makes it unfavourable, though there are ways which can help overcome these limitations.

Areas that can be improved:

Speed (loops,array element lookup, switch cases, conditional)

This includes programs like calculating 25000th prime number, which in JavaScript is around 10x slower than languages like c,c++ using the same algorithm

Memory (large arrays, large no of JSON objects)

This includes programs like storing a 1000 JSON objects which causes memory allocation failure, also note that we don't have database in competitions and everything needs to be done in-memory.

Language Limitations (large numbers)

This includes programs like calculating factorial of a large number(say 1000) while in JavaScript if you try to calculate factorial above 170 it gives you infinity because it exceeds language's number limit

This repository will have examples for the above mentioned areas and implementations through which we can overcome these limitations.

Repo Structure

All the programs are grouped under speed and memory and are placed inside src/programs directory. Each program has following implementations:

  1. Brute force algorithm and non optimized javascript.
  2. Brute force algorithm and optimized javascript.
  3. Optimized algorithm and optimized javascript.

competitve-javascript's People

Contributors

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