Giter Site home page Giter Site logo

intro-to-algorithm-exercises's Introduction

Intro-to-Algorithm-Exercises

Implementing algorithms in the book of "Introduction to Algorithms" 3rd ed & various technical interview questions

Various Interview Questions Exercise

All exercies are written in javascript

Copy to console in your browser or node filename.js to see the codes running

  1. Chapter 2 : Insertion Sort & Merge Sort

  2. Greedy Algorithm : a. getMaxProfit(stockArray) : find the max profit given an array containing stock price from the day before

    b. getProductsOfAllIntsExceptAtIndex(intArray) : find the product of all numbers in the array except for the number at index

    c. findMaxProduct(intArray) : find the maxProduct from 3 numbers in a given array

    d. mergeTime(timeArray) : merge meeting time

  3. Recursion : a. class fib : utilizing memoization to save recursive runs b. ascii_distance(str1, str2) : utilize Levenshtein Distance algorithm to find ascii code differences between two strings

  4. Intersection: Finding Intersection between two rectangles

  5. Temperarture Tracker : track temperature, utilize class method to track min, max, mean & mode

  6. Binary Tree: a. superbalanced - difference between the depths of any two leaf nodes is no greater than one.

    b. binary search tree - check if a binary tree is a valide binary search tree

    c. find the 2nd largest element in a binary search tree.

    d. binary search - find integer in a sorted array

    e. binary search - find index of the rotating point in an array with words alphabetically sorted

  7. Trie: a. Optimize space to store URLs.

  8. Set: a. find two integers sum up to a number in an array of numbers

  9. Memoization: a. fibonacci three ways!

  10. Stack & Queue: a. optimize runtime for getMax() for a Stack b. construct a queue from two stacks c. finding closing parenthesis d. validate brackets/braces/parenthesis

  11. Prime Number: a. testing isPrime for every number b. find prime number using Sieve of Eratosthenes

  12. bit: a. find unique number or letter using bit wise calculation

  13. Linked List: a. fastest way to delete a node in a singly linked list given only the node.

    b. detect if a linked list has a cycle

    c. reverse a linked-list in place

    d. navigate to nth to the last node in a linked list

intro-to-algorithm-exercises's People

Stargazers

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