Skip to content

Contains JavaScript attempts on algorithm and data structures questions gotten from multiple sources

Notifications You must be signed in to change notification settings

TWEEDOriginal/Algorithms-and-DataStructures

Repository files navigation

Algorithms and DataStructures Solutions - JavaScript

Introduction

  • This repository contains JavaScript attempts on algorithm and data structures questions gotten from multiple sources such as Cracking the Coding Interview (CTCI) 6th edition, HackerRank and Leetcode.

  • The files only contain code, and do not contain ANY question. For CTCI questions, please support Gayle Laakmann McDowell by purchasing the book. For other questions you can find them for free on their respective platforms.

  • In each JavaScript file, there are simple tests to check that the code is working as expected. For convenience, simple logging is used to test the functions. In your terminal type node <path-to-fileName>.js to run the tests.

  • Contributions welcome

List of Coding Questions:

Arrays And Strings

  • Count Anagrams - CTCI
  • Check Permutation - CTCI
  • URLify - CTCI
  • Palindrome Permutation - CTCI
  • One Away - CTCI
  • String Compression - CTCI
  • Rotate Matrix - CTCI
  • Zero Matrix - CTCI
  • String Rotation - CTCI
  • Minimum Bribes - HackerRank
  • Minimum Swaps 2 - HackerRank
  • Array Manipulation - HackerRank
  • Sherlock and the Valid String - HackerRank
  • Special String Again - HackerRank
  • String to Dictionary
  • Common Child - HackerRank
  • Football Scores - HackerRank coding interview question

Dictionaries and Hashmaps

Linked Lists

  • Remove Dups - CTCI
  • Return Kth to Last - CTCI
  • Delete Middle Node - CTCI
  • Partition - CTCI
  • Sum Lists - CTCI
  • Palindrome - CTCI
  • Intersection - CTCI
  • Loop Detection - CTCI

Stacks and Queues

  • Three in One - CTCI
  • Stack Min - CTCI
  • Stack of Plates - CTCI
  • Queue via Stacks - CTCI
  • Sort Stack - CTCI
  • Animal Shelter - CTCI
  • Balanced Brackets - HackerRank
  • Largest Rectangle - HackerRank
  • Min Max Riddle - HackerRank
  • Poisonous Plants - HackerRank
  • Castle on the Grid - HackerRank

Trees and Graphs

  • Auto Suggest
  • Route Between Nodes - CTCI
  • Minimal Tree - CTCI
  • List of Depths - CTCI
  • Check Balanced - CTCI
  • Validate BST - CTCI
  • Successor - CTCI
  • Build Order - CTCI
  • First Common Ancestor - CTCI
  • BST Sequences - CTCI
  • Check Subtree - CTCI
  • Random Node - CTCI
  • Paths with Sum - CTCI
  • Roads and Libraries - HackerRank
  • Find the nearest clone - HackerRank
  • BFS: Shortest Reach in a Graph - HackerRank
  • DFS: Connected Cell in a Grid - HackerRank
  • Matrix - HackerRank
  • Tree: Huffman Decoding - HackerRank

Bit Manipulation

  • Insertion - CTCI
  • Binary to String - CTCI
  • Flip Bit to Win - CTCI
  • Next Number - CTCI
  • Conversion - CTCI

Object Oriented Design

  • Deck of Cards - CTCI
  • Call Center - CTCI
  • Jigsaw - CTCI

Recursion and Dynamic Programming

  • Triple Step - CTCI
  • Robot in a Grid - CTCI
  • Towers of Hanoi - CTCI
  • Coins - CTCI
  • Crossword Puzzle - HackerRank
  • Knapsack - HackerRank
  • Construct Target Word
  • Abbreviation - HackerRank

Miscellanous


Test

npm test

About

Contains JavaScript attempts on algorithm and data structures questions gotten from multiple sources

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published