Practice, practice and more practice!
======
Devise a plan for solving problems:
- Understand the problem
- Explore concrete examples
- Break it down
- Solve / Simplify
- Look back and refactor
- Can I restate the problem in my own words?
- What are the inputs that go into the problem?
- What are the outputs that should come from the solution to the problem?
- Can the outputs be determined from the inputs? In other words, do I have enough information to solve the problem?
- How should I label the important pieces of data that are a part of the problem?
- This helps to double check that you completely understood the problem and what it's been asked.
- Write down a list of steps to solve the problem.
- It doesn't have to be pseudocode.
- If you can't solve a problem right away. Solve something similar first (an easier version).
- Can you check the result?
- Can you derive the result differently?
- Can you understand it at a glance?
- Can you use the result or method for some other problem?
- Can you improve the performance of your solution?
- Can you thing of other ways to refactor?
- How have other people solved this problem?
Master common problem solving patterns:
- Frequency Counter
- Multiple Pointers
- Sliding Window
- Divide and Conquer
- Dynamic Programming
- Greedy Algorithms
- Backtracking
- ... And many more!
- Recursion
- Searching
- Sorting
- BubbleSort
- InsertionSort
- SelectionSort
- MergeSort
- QuickSort
- Data Structures
- Singly Linked List
- Doubly Linked List
- Queue
- Stack
- Trees:
- Binary Tree
- Binary Search Tree (BST)
- Tree Traversal:
- Depth-First Search (DFS)
- InOrder
- PreOrder
- PostOrder
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- Binary Heap:
- Max Binary Heap
- Min Binary Heap
- Priority Queue
- HashTables
- Graphs:
- Adjacency Matrix
- Adjacency List
- Graph Traversal:
- Depth First Graph Traversal
- Breadth First Graph Traversal