Here is a link where I have coded several hundred leetcode problems in C++.
Here is a link where I have coded several hundred leetcode problems in Java. These problems are mostly different from the C++ ones.
Here i have uploaded hand written notes on major graph algorithms such as union find, min spanning trees, topological sort, Shortest Path (Dijkstra), Bellman Ford, Detecting nodes that are part of a cycle, Prim’s algorithm, Floyd Warshall, Kosaraju Strongly Connected components, Tarjan’s strongly connected component and Johnson’s algorithm
Here i have uploaded hand written notes on how to solve some of the hardest graph problems on leetcode.
Here i have uploaded hand written notes on how to solve some of the hardest dynamic programming questions on leetcode.
Here i have uploaded hand written notes on how to solve some of the hardest binary search problems on leetcode.
Coding solutions explained on this website
I have coded several hundred coding problems from leetcode, solutions to which I have posted on github (see below). From amongst the leetcode questions that I have coded, I have included here simplified explanations for over 100 questions that I consider most important to practice. I have categorized these questions under topics inside the “Coding Algorithms” menu. These topics are per data structures and algorithms concepts such as graphs, trees, trie, bitwise operations, permutations, probability, recursion and more.
My motivation to add these solutions here is to have a good set of questions to practice and provide very simple solutions for these questions that my hope is very easy to follow.
Below are links organized into computer science topics for the coding question:
- Arrays
- Binary Search
- Bitwise operations
- Design
- Dynamic Programming
- Graphs
- A*
- BFS
- DFS
- Union Find
- Evaluate Division
- Robot Room Cleaner
- Word Search
- Hash Maps
- Linked List
- Logic
- Container with most water
- Largest Rectangle in Histogram
- Longest Absolute File Path
- Majority Element (Boyer-Moore Voting Algorithm)
- Maximum Points You Can Obtain from Cards
- Minimum Area Rectangle
- Minimum Domino Rotations For Equal Row
- Rotate Image
- Partition Labels
- Count of Smaller Numbers After Self
- Task Scheduler
- UTF-8 Validation
- 3Sum
- ZigZag Conversion
- Matrices
- Permutation
- Priority Queue
- Probability
- Recursion
- Sorting
- Stack
- String
- Trees
- Binary Tree Right Side View
- Binary Tree Zigzag Level Order Traversal
- Closest Leaf in a Binary Tree
- Convert Binary Search Tree to Sorted Doubly Linked List
- Construct Binary Tree from Preorder and Inorder Traversal
- Delete Node in a BST
- Delete Nodes And Return Forest
- N-ary Tree Postorder Traversal
- N-ary Tree Preorder Traversal
- Time Needed to Inform All Employees
- Validate Binary Search Tree
- Trie
Coding questions and solutions on github
I have solved here several hundred coding questions where the source of the questions has been leetcode. The solutions are available on github at : https://github.com/zcoderz/leetcode.git
These are top questions across all organizations and in addition top questions specifically by google, facebook and amazon. In addition, I have included questions that are good practice per the topic (graphs, trees, trie, dynamic programming and others).
In the github site, the questions are organized by topic (graph, hash_maps, trees, trie,…). And in addition, by company (google, facebook & amazon), the questions are further classified in difficulty as either hard or medium.
In addition, I have further classified the questions as one of below for the more important questions:
- IMP-1: These questions are extremely important to practice and are classified as such because they are good practice for a pattern of questions that repeats or are just very commonly asked. (Some of these are included above as “Extremely Important”).
- IMP-2: These are also important but less than IMP-1. (Some of these are included above as “Very Important”).
- IMP-3: Similarly, these are important but less than IMP-2. (Some of these are included above as “Important”).
For many of the questions I have coded several solutions and explained in comments pros and cons of various solutions. I have also included inline comments in the coding solutions. Each question also has reference to the source leet-code question using the question’s unique number.
Here is a link to a github repository where I have cataloged c++ language enhancements since C++11 such as auto, consexpr, move semantics, polymorphic memory, views_and_ranges, variant, stl algos, templates, lambda, file system, exceptions, enum, constructor and other major enhancements.