This is repository of data structures and algorithms written in Javascript and Ruby. Some of the algorithms are from Cracking the Coding Interview by Gayle Laakmann McDowell .
#Contributing
To contribute, fork this repo and create a pull request. Please include a short descriptive link to the code in the readme. If your code requires further explanation, you can include a more detailed explanation in the Data Structures or Algorithms subfolder's readme. Tests are optional.
If you're looking for inspiration:
##Ruby instructions:
To run Ruby specs, execute the rspec
command in the terminal
##Javascript Instructions
To run Javascript specs, execute the rake jasmine
command in the terminal. Then open the browser to
http://localhost:8888/
#Data Structures
###Javascript:
###Ruby:
- Binary Tree
- Doubly Linked List
- Singly Linked List
- Linked Stack
- Weighted Graph
- LRU Cache
- Hash Map
- Linked List
#Algorithms
###JavaScript:
- Anagrams
- Balanced Parens
- Breadth First Search
- Climbing Stairs
- Contains Duplicate
- Delete Node in linked list
- Depth First Search
- Digital Root
- Fibonacci Number
- Hamming Weight
- HiCal
- Highest Product of 3
- Invert Binary Tree
- Is Same Tree
- Majority Element
- Make Change
- Max Depth Binary Tree
- Merge Two Sorted Lists
- Min Depth Binary Tree
- Palindrome
- Permutation Palindrome
- Power of 2
- Product of All Ints Except @ Index
- Quicksort
- Remove Value
- Reverse Linked List
- Roman Numeral -> Integer
- Second Largest Value in Binary Tree
- Stock Picker
- Subsets
- Substrings
- Symmetric Binary Tree
- Transpose
- Valid Anagram
- JSON.Stringify
- UnderscoreJS
###Ruby:
- Add Binary
- Anagrams
- Balanced Binary Tree
- Create Binary Search Tree From Array
- Caeser Cipher
- Danny Search
- Delete Kth Node in Linked List
- Difference Between Arrays
- Find Single Number
- Graph Breadth First Search
- Graph Depth First Search
- Invert Binary Tree
- Isomorphic Strings
- Longest Common Prefix
- Max Depth Binary Tree
- Merge Sorted Arrays
- Min Change Sum
- Min Depth Binary Tree
- Palindrome Linked List
- Pascal's Triangle
- Permutation Palindrome
- Rate Limiter
- Remove Duplicates in Text
- Rotate Array
- Seive of Erastenous
- Shuffle Array in Place
- Traverse Spiral Matrix
- Tree Breadth First Search
- Two Sum
- Valid Binary Tree
- Convert Binary Tree to DLL
- Count Primes
- Dijkstras
- First Bad Version
- BST Inorder Traversal
- Largest BST in BT
- Draw BST Root->Leaf Paths
- Summary Ranges
- Topological Sort
- Trace Path Eating Carrots
- Detect Cycle in Graph
- Resolve Dependencies
- Rectangular Overlap
- Divide Without Division
- Kth Smallest From 2 Arrays
- BT Lowest Common Ancestor
- Enumerables
- Deep Dup
- XOR
- Recursive Stack Sort
- Recurive Reverse Stack
- Lexigraphical Permutations
- Square Root
#Cracking the Coding Interview
##Data Structures:
###JavaScript:
##Algorithms:
###Ruby:
- Add Reverse Linked List Digits
- Basic String Compression
- Encode URL
- Find Linked List Cycle
- Linked List Palindrome
- Make Change
- One Edit Away
- Partition Linked List
- Path Between Two Nodes
- Permutation Strings
- Remove Duplicates from Linked List
- Reverse Characters and String
- String is Substring
- Tree Path Equals Sum
- Unique Characters
- Least Common Ancestor in BST
- Missing Number
###Dynamic Programming: