/Leetcode

This is a compilation of my Leetcode questions

Primary LanguageC++

Rico's Leetcode Compilation

Author: Rico Ruotong Jia

Description

This is a compilation of Rico's Leetcode question solutions from 06/23/2020. Some of his old questions can be seen here: https://leetcode.com/ricoruotongjia/ The most important thing is not to come up with a solution, but to know how to solve problems in multiple ways. In this repo, there will be problems in these topics (no Hard questions, )

  1. Data Structures

    • Array (Month 1)
    • Linked List (Month 1)
    • Hash Table (Month 1)
    • String (Month 1)
    • Tree (Month 3)
    • Stack & Queue(Month 3)
    • Heap (Month 3)
  2. Search algorithms (People have been working on these for years. Learn them well!)

    • Search Algorithms (Binary Search, Divide and Conquer) (Month 1)
    • Sort algorithms (Month 1)
    • Graph (shortest path, minimal spanning tree, (Month 3))
    • Backtracking (Month 2)
    • BFS, DFS (Month 2)
    • Dynamic Programming (Month 2)
    • Trie (Month 2)
    • Greedy (Month 3)
  3. Others

    • Bit manipulation ((Month 3)
  4. See here for a detailed list of questions

Usage

  1. Test framework: Catch 2
    • As a good software engineer, familiarity with unit testing is an essential skill. Catch2 is a very light-weight and fast testing framework. It is as simple as a single header file. In each directory, simply run g++ test.cc -o test && ./test to run a test and see the result.
  2. List of questions: some other good questions + solutions Also, check out another set of Solutions to some good questions and good explanation (Mandarin)

Notes

  1. How to do Leetcode Questions efficiently - You might want to go through these questions multiple times. Also, make a reachable plan - start from small number of easy questions. Consistency matters.
    • Know the concept. See crack the coding interview book
    • Try to think first. If there's no luck, go check out the discussion section.
    • At the beginning, try to use an IDE to get the correct result. Then, rewrite the program on the website to enhance memory. As time goes along, you will get more comfortable with the syntax.
    • Make a quick summary in each directory's readme.
    • Keep improving your solution. This is even more important than having a solution!
    • Practice easy questions first, but move to medium ASAP: medium questions are more frequent than the easier ones!
    • Graph, Dynamic Programming, backtracking are not well covered in easy questions. Do medium questions on these topics.
    • Doing a couple problems at a time is better than doing them one at a time.

Very useful Resources

  1. Leetcode Strategies
  2. Explanation

Additional Useful Resources (watch these if you have time)

  1. Videos on advanced algorithms

References

  1. Priority