LeetCode Advised Problems Sorted by Topics and Directions
15010

Hello everyone. I received a lot of questions regarding how to solve problems, your approach, which we need to know, important problems and etc. and in this post I wanted to show and share with all of you with the list of my favorite and in my opinion the problems which will be better to solve to better understand the topic and solve problems efficiently. I will try to add every topic from LeetCode, but it is somehow hard do everything at one time, so time by time I will update this post. Let's begin.

LINKED LIST PROBLEMS:

LINK TO LIST: https://leetcode.com/list/50sfo32d

This list contains the problems to all levels. I included mostly easy and medium problems and one hard problem which is my favorite. How to approach linked list problems:

  1. Learn main concepts of Linked List
    1.1. What is Linked List ?
    1.2. How to add node to head, middle, end of Linked List ?
    1.3. How to delete node from head, middle, end of Linked List ?
  2. Linked List traversal
    2.1. Iterative method.
    2.2. Recursive method.
  3. Try to solve problems by using paper and pen or pencil. Why it is important ? When you will visually see how you are going to traverse or make changes to Linked List you will understand what you are actually doing right or wrong. I solved hard problem by drawing it on paper and it was really easy.

STACK PROBLEMS:

LINK TO LIST: https://leetcode.com/list/504xdrcr

This list contains the problems to all levels. I included many easy and medium problems. How to approach stack problems:

  1. Learn main concepts of Stack
    1.1. What is Stack ?
    1.2. Basick stack functions such as push(), pop(), top(), and etc.
    1.3. Prefix, Infix, Postfix notations.
  2. Standard problems:
    2.1. Reverse string with stack.
    2.2. Reverse linked list using stack.
    2.3. Valid Parentheses.

After learning Stack learn the Queue. It is important to know both of them. For both Stack and Queue learn how to implement them using Array and Linked List. It is just to understand their work principle better.

TREE PROBLEMS:

LINK TO LIST: https://leetcode.com/list/504mfxd2

This list contains the problems to all levels. I included many easy and medium problems. This topic is one of the favorite interview topics. How to approach tree problems:

  1. Learn main concepts of Trees
    1.1. What are the different types of trees ?
    1.2. How to search value in BST ?
    1.3. How to add or delete a value in BST ?
    1.4. How to find a height of a tree ?
    1.5. How to construct a BST ?
  2. Tree traversals
    2.1. Level-order traversal both iterative and recursive methods.
    2.2. Preorder traversal both iterative and recursive methods.
    2.3. Inordered traversal both iterative and recursive methods.
    2.4. Postorder traversal both iterative and recursive methods.
  3. Also learn how to represent root-leaf node paths, I promise you there are many problems where you will use this.

You ask you I included so many problems to Trees and the answer is that many of them are similar and can be solved by applying the similar logic. Revision can help to build an strong base.

HASH TABLE AND MAP PROBLEMS:

LINK TO LIST: https://leetcode.com/list/504wrexe

This list contains the problems to all levels. I included many easy and medium problems. How to approach hash table and map problems:

  1. Learn main concepts
    1.1. What is Hash Table ?
    1.2. What is an Map ?
    1.3. Their implementation: unordered_map<>, map<>.
  2. To be honest, I watched many lectures and videos and all of them repeated the same things and were not so useful in problem solving. What I advise is it look for their implementation from library, which build-in functions they have and what particular function does.
  3. Begin from easy problems, and think which functions will be useful in solving this particular problem, work with library.

SORTING PROBLEMS:

LINK TO LIST: https://leetcode.com/list/5047kw65

This list contains the problems to all levels. I included many easy and medium problems and also one hard problem for which we actually needed to use linear time sorting algorithm. How to approach sorting problems:

  1. Learn main concepts sorting algorithms
    1.1. Quadratic sorting algorithms: bubble, insertion, selection sorts
    1.2. Divide and Conquer sorting algorithms: merge and quick sorts
    1.4. Heap Sort
    1.3. Linear sorting algorithms: count, radix. Here we should also know some cases when they sort not at linear time.
  2. Practice

SEARCHING PROBLEMS:

LINK TO LIST: https://leetcode.com/list/504ixc37

This list contains the problems to all levels. I included many easy and medium problems. How to approach searching problems:

  1. Learn main concepts searching algorithms
    1.1. Linear search.
    1.2. Binary search.
    1.3. Ternary search.
  2. Practice

GREEDY PROBLEMS:

LINK TO LIST: https://leetcode.com/list/5ik01ftj

This list contains the problems to all levels. I included many easy and medium problems. How to approach greedy problems:

  1. Think how sorting can help you.
  2. Practice
  3. There are standard problems related to greedy, but actually it will be better if you will try to solve first by yourself. I will update the Greedy and add other problems.

I did not include DP, Graphs, and Strings. I will do it later and will update this post.

I hope this post will help you. Begin from easy problems and try to solve some similar problems to better understand. Do not try to cheat. If you are cheating the you are making no progress. If you cannot solve problem more than 2 hours then skip but do not forget to return and solve it. I think that even if you will spend large amount of time but solve by yourself then it is an progress. If you have any suggestions like what to include to this post, which additional problems to add, or if you have questions please write to comments section. I will read every comment and try to answer when I have free time. Thanks !

Comments (19)