Giter VIP home page Giter VIP logo

30-days-of-algorithms's Introduction

30-Days-of-Algorithms

Studying one algorithm per day for 30 days to strengthen my programming skills.

Background

I got my university degree in graphic design. I didn't start coding until I was 28. I do not have a background in computer science, and I've always felt self-conscious about that. Until recently, it had never directly impacted my career.

I recently did not make it past a first-round coding challenge because my code was "too complex". I went online to see if I could find evidence to prove the reviewer wrong. What I discovered very quickly is, "SHE WAS RIGHT". I was really hurt and disappointed in myself, but I am not one to navel-gaze for long. I decided to see it as a challenge and learning experience.

To strengthen my understanding of the most common and most useful algorithms, I decided to pick one algorithm every day for 30 days and learn how to use it effectively and to commit it to memory.

Life being what it is - which is to say unpredictable and hectic - I may not post an alogirthm every single day, but I will post one "for" every day. For instance, today I am posting the first 3 days. Some days I may not have time to post one but I will make up for any missed days.

I will not only add each algorithm here but will post each one as a public gist. feel free to join the discussion on the gists.

The Algoritms

Euclid's Algorithm for finding the greatest common divisor of two positive integers.

Algorithm to find the missing number given an array of positive integers from 1 - N, with no duplicates and only one missing number.

Bubble sort has a worst-case and average complexity of О(n2), where n is the number of items being sorted. Even though it is not the most efficient algorithm, it is worth knowing how to do.

Efficient algorithm to find the intersection of two lists. This is a common coding test problem but also a common problem to encounter in real-world apps.

This is a very elegant solution by Philip Stanislaus that converts a flat array into a tree in O(n) time. It works in a single pass. Look, ma. No Recursion !!! :-)

Although it is not the most efficient sorting algorithm, Merge Sort is good to know and is fairly easy to implement.

Quicksort is one of the most efficient sorting algorithm with O(log n) Big-O notation. It can be 2x - 3x faster than merge sort. This article by César Antón Dorantes does a great job explaining how it works.

Binary search is a divide-and-conquer algorith. Start with a sorted list, work from the ends, split the list in half, and determine which half to discard.

30-days-of-algorithms's People

Contributors

iconifyit avatar

Watchers

 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.