javascript-problems-and-solutions
v2.0.1
Published
A collection of JavaScript problems and solutions for studying algorithms.
Downloads
43
Readme
javascript-problems-and-solutions
A collection of JavaScript problems and solutions for studying algorithms.
Table of Content
- Data Structures
- Array
- Matrix
- String
- Sorting
- Binary Search
- Tree
- Graph
- Trie (Prefix Tree)
- Backtracking
- Breadth First Search
- Depth First Search
- Divide and Conquer
- Linked List
- Dynamic Programming
- Greedy
- Math
- System Design
Data Structures
Problems
Array
- Median of Two Sorted Arrays
- Plus One
- Trapping Rain Water
- Merge Intervals
- Spiral Matrix
- Summary Ranges
- Find All Numbers Disappeared in an Array
- Game of Life
- Next Permutation
- Find Peak Element
- Wiggle Sort
- Valid Triangle Number
- Find Anagram Mappings
- K Empty Slots
Matrix
String
- Regular Expression Matching
- Letter Combinations of a Phone Number
- Valid Parentheses
- Generate Parentheses
- Generate Parentheses II
- Shortest Palindrome
- Palindrome Pairs
- First Unique Character in a String
- Judge Route Circle
- Reverse Vowels of a String
- Add Bold Tag in String
- Minimum Window Substring
- Longest Absolute File Path
Sorting
Binary Search
- Binary Search
- Search in Rotated Sorted Array
- Search in Rotated Sorted Array II
- Divide Two Integers
- Power(x, n)
Tree
- Add One Row to Tree
- Balanced Binary Tree
- Binary Search Tree I - Search
- Binary Search Tree II - Insert
- Binary Search Tree II - Delete
- Binary Search Tree Iterator
- Binary Tree Inorder Traversal
- Binary Tree Level Order Traversal
- Binary Tree Longest Consecutive Sequence
- Binary Tree Longest Consecutive Sequence II
- Binary Tree Maximum Path Sum
- Binary Tree Paths
- Binary Tree Postorder Traversal
- Binary Tree Preorder Traversal
- Binary Tree Upside Down
- Binary Tree Zigzag Level Order Traversal
- Closest Binary Search Tree Value
- Closest Binary Search Tree Value II
- Construct Binary Tree From Preorder and Inorder Traversal
- Construct Binary Tree From Postorder and Inorder Traversal
- Convert BST to Greater Tree
- Convert Sorted Array to Binary Search Tree
- Count Univalue Subtrees
- Delete Node in a BST
- Diameter of Binary Tree
- Find Bottom Left Tree Value
- Find Largest Value in Each Tree Row
- Find Mode in Binary Search Tree
- Flatten Binary Tree to Linked List
- House Robber III
- Inorder Predecessor in BST
- Inorder Successor in BST
- K-th ancestor of a node in Binary Tree
- Kill Process
- Longest Univalue Path
- Lowest Common Ancestor of A Binary Search Tree
- Lowest Common Ancestor of a Binary Tree
- Maximum Binary Tree
- Maximum Depth of Binary Tree
- Maximum Width of Binary Tree
- Minimum Depth of Binary Tree
- Most Frequent Subtree Sum
- Path Sum
- Path Sum II
- Path Sum III
- Path Sum IV
- Populating Next Right Pointers in Each Node
- Populating Next Right Pointers in Each Node II
- Recover Binary Search Tree
- Same Tree
- Serialize and Deserialize BST
- Serialize and Deserialize Binary Tree
- Subtree of Another Tree
- Sum Root to Leaf Numbers
- Symmetric Tree
- Trim a Binary Search Tree
- Unique Binary Search Trees
- Unique Binary Search Trees II
- Univalue Tree
- Validate Binary Search Tree
- Verify Preorder Sequence in Binary Search Tree
Graph
- Clone Graph
- Course Schedule
- Course Schedule II
- Alien Dictionary
- Alien Dictionary II
- Graph Valid Tree
- Number of Connected Components in an Undirected Graph
- Reconstruct Itinerary
- Evaluate Division
- Sequence Reconstruction
- Minimum Height Trees
- Redundant Connection
- Redundant Connection II
Trie (Prefix Tree)
- Implement Trie (Prefix Tree)
- Add and Search Word
- Word Search II
- Longest Word in Dictionary
- Map Sum Pairs
- Implement Magic Dictionary
- Replace Words
- Top K Frequent Words
- Concatenated Words
- Palindrome Pairs
- Design Search Autocomplete System
- Word Squares
- Maximum XOR of Two Numbers in an Array
- Add Bold Tag in String
Backtracking
- Subsets
- Subsets II
- Combinations
- Combination Sum
- Combination Sum II
- Combination Sum III
- Permutations
- Permutations II
- N-Queens
- N-Queens II
- Generate Parentheses
- Generate Parentheses II
- Word Search
- Word Search II
- Sudoku Solver
- Regular Expression Matching
- Wildcard Matching
- Letter Combinations of a Phone Number
- Letter Case Permutation
- Count Numbers with Unique Digits
- Restore IP Addresses
Breadth First Search
Depth First Search
Divide and Conquer
Linked List
Dynamic Programming
- Longest Increasing Subsequence
- Longest Palindromic Subsequence
- Longest Palindromic Substring
- Longest Consecutive Sequence
- Regular Expression Matching
- Wildcard Matching
- Word Break
- Word Break II
- Best Time to Buy and Sell Stock
- Best Time to Buy and Sell Stock II
- Best Time to Buy and Sell Stock III
- Best Time to Buy and Sell Stock IV
- Best Time to Buy and Sell Stock with Cooldown
- Best Time to Buy and Sell Stock with Transaction Fee
- Gas Station III
- Perfect Squares
- Subset Sum Problem
- Matrix Chain Multiplication
- Burst Balloons
Greedy
Math
System Design
Author
I solve algorithm problems using JavaSript and Java, you can find all my LeetCode solutions and posts here.
Support
LICENSE
MIT License
Copyright (c) 2017 Yong Su
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.