Git Product home page Git Product logo

problem_solving's Introduction

Data Structures and Algorithms -- Yankun (Alex) Meng

Problem Solving Strategy:

  1. Read carefully and model the problem, Ask Questions
  2. Build Intuition through visualizing examples
  3. Write out high level idea / Pseudocode
  4. Implement in actual code
  5. Analyze your algorithm and seek improvement (time, memory, code quality)

Top 10 Problem Types Ranked:

  1. Recursion / Backtracking (39, 40, 78, 90, 46, 47)
  2. Graph Traversal, BFS, DFS (133, 127, 490, 210, 269)
  3. Binary Tree (94, 236, 297, 102)
  4. Binary Search (34, 162, 69)
  5. Hash Table, Queue/Stack, Heap (242, 133, 127, 155, 225, 215, 23)
  6. Linked Lists (237, 92, 876, 143)
  7. Two Pointers / Sliding Window (239, 3, 76)
  8. Sorting/Questions that involve sorting as a trick (148)
  9. Real Life Implementations (146, 1066, 490)
  10. Dynamic Programming (know concepts)

The 14 Patterns:

  1. Sliding Window
  2. Two Pointers or Iterators
  3. Fast and Slow Pointers
  4. Merge Intervals
  5. Cyclic Sort
  6. In-place Reversal of Linked List
  7. Tree BFS
  8. Tree DFS
  9. Two Heaps
  10. Subsets
  11. Modified Binary Search
  12. Top K Elements
  13. K-Way Merge
  14. Topological Sort

Problem Record Format:

(Date) [Question Title] (level) <br>

(7/20/2023) 11. Container With Most Water (Medium)
(7/20/2023) 26. Remove Duplicates from Sorted Array (Easy)
(7/20/2023) 344. Reverse String (Easy)
(7/21/2023) 283. Move Zeros (Easy)
(7/22/2023) 1047. Remove All Adjacent Duplicates In String (Easy)
TODO: 42. Trapping Rain Water
TODO: 80. Remove Duplicates From Sorted Array II

TODO: 560. Subarray Sum Equals K

(7/18/2023) 33. Search in Rotated Sorted Array (Medium)
TODO: 74. Search a 2D Matrix

(7/21/2023) 876. Middle Of The Linked List (Easy)
(7/22/2023) 19. Remove Nth Node From End Of List (Medium)
(8/4/2023) 206. Reverse Linked List (Medium)
(8/10/2023) 92. Reverse Linked List II (Medium)
TODO: 237. Delete node in a linked list
TODO: 141. Linked List cycle
TODO: 92. Reverse Linked List II
TODO: 25. Reverse Nodes in k-Group
TODO: 21. Merge Two Sorted Lists

(7/20/2023) 20. Valid Parentheses (Easy)
(7/20/2023) 496. Next Greater Element I (Medium)
(7/20/2023) 735. Asteroid Collision (Medium)
(7/20/2023) 739. Daily Temperatures (Medium)
TODO: 503. Next Greater Element II
TODO: 394. Decode String
TODO: 636. Exclusive Time of Functions
TODO: 84. Largest Rectangle in Histogram

(7/31/2023) 215. Kth Largest Element in an Array (Medium)
(7/31/2023) 23. Merge K Sorted Lists (Hard)
347,253,295,767,703, 218

(8/2/2023) 1. Two Sum (Easy)
(8/2/2023) 138. Copy List with Random Pointer (Medium)
(8/2/2023) 3.Longest Substring Without Repeating Characters (Medium)
(10/2/2023) 819. Most Common Word (Easy)
49, 340, 554, 535.

(7/16/2023) 270. Closest Binary Search Tree Value (Easy)
(7/16/2023) 110. Balanced Binary Tree (Easy)
(7/16/2023) 222. Count Complete Tree Nodes (Medium)
(7/16/2023) 114. Flatten Binary Tree to Linked List (Medium)
(7/18/2023) 257. Binary Tree Paths (Easy)
(7/18/2023) 199. Binary Tree Right Side View (Medium)
(7/18/2023) 257.Binary Tree Paths (Medium)
(8/12/2023) 700. Search in a Binary Search Tree (Easy)
TODO: 95. Unique Binary Search Trees II
TODO: 98. Validate Binary Search Tree
TODO: 100. Same Tree
TODO: 94. Binary Tree Inorder Traversal
TODO: 426. Convert Binary Search Tree to Sorted Doubly Linked List

(7/24/2023) 111. Minimum Depth of a Binary Tree (Easy)
(7/24/2023) 102. Binary Tree Level Order Traversal (Medium)
(7/24/2023) 515. Find Largest Value in Each Tree Row (Medium)
(7/26/2023) 103. Binary Tree Zigzag Level Order Traversal (Medium)
(7/26/2023) 104. Maximum Depth of Binary Tree (Medium)
(7/26/2023) 429. N-ary Tree Level Order Traversal (Medium)
(7/26/2023) 101. Symmetric Tree (Medium)

(7/27/2023) 508. Most Frequent Subtree Sum (Medium)
(8/12/2023) 450. Delete Node In A BST (Medium)
(8/12/2023) 938. Range Sum of BST (Easy)
TODO: 98. Validate Binary Search Tree
TODO: 110. Balanced Binary Tree
TODO: 113. Path Sum II
TODO: 236. Lowest Common Ancestor of a Binary Tree

TODO: 417. Pacific Atlantic Water Flow (Medium)
TODO: 695. Max Area of Island (Medium)
TODO: 1020. Number of Enclaves (Medium)
TODO: 1254. Number of Closed Islands (Medium)

(7/28/2023) 542. 01 Matrix (Medium)
(7/28/2023) 127. Word Ladder (Hard)
TODO: 934. Shortest Bridge
TODO: 310. Minimum Height Trees
TODO: 1091. Shortest Path in Binary Matrix
TODO: 994. Rotting Oranges
TODO: 863. All Nodes Distance K in Binary Tree
TODO: 317. Shortest Distance from All Buildings

(8/4/2023) 743. Network Delay Time (Medium)
(8/4/2023) 787. Cheapest Flights within K Stops (Medium)
TODO: 264. Ugly Number II
TODO: 373. Find K Pairs with Smallest Sums
TODO: 778. Swim in Rising Water
TODO: 378. Kth Smallest Element In A Sorted Matrix

(8/7/2023) 200. Number of Islands (Medium)
(8/7/2023) 332.Reconstruct Itinerary (Medium)
TODO: 133. Clone Graph
TODO: 399. Evaluate Division
TODO: 785. Is Graph Bipartite
TODO: 841. Keys and Rooms

(8/10/2023) 78. Subsets (Medium)
(8/10/2023) 139. Word Break (Medium)
TODO: 22. Generate Parentheses
TODO: 35. Maximum Subarray
TODO: 70. Climbing Stairs
TODO: 90. Subsets II
TODO: 332. Coin Change
TODO: 746. Min Cost Climbing Stairs
TODO: 96. Unique Binary Search Trees

TODO: 78. Subsets
TODO: 77. Combinations
TODO: 46. Permutations
TODO: 17. Letter Combinations of a Phone Number
TODO: 51. N-Queens
TODO: 52. N-Queens II
TODO: 489. Robot Room Cleaner
TODO: 37. Sudoku Solver
TODO: 22. Generate Parentheses

(7/23/2023) 344. Reverse String (Easy)
(7/23/2023) 24. Swap Nodes in Pairs (Medium)
(7/24/2023) 50. Pow(x, n) (Medium)
TODO: 912. Sort an Array
TODO: 118. Pascal's Triangle
TODO: 119. Pascal's Triangle II
TODO: 779. K-th Symbol in Grammar
TODO: 509. Fibonacci Number
TODO: 70. Climbing Stairs

problem_solving's People

Contributors

yankunm avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.