PDF Google Drive Downloader v1.1


Báo lỗi sự cố

Nội dung text DSA Sheet.pdf

Ashish Garg’s Must DSA Sheet Below are some of the most commonly used patterns that form the basis for 60– 70% of DSA problems. (Disclaimer: This list is intended as a starting point. Once you begin, you'll naturally discover your own path while working through the problems.) 1. 2 Heaps 2. Arrays 3. Backtracking 4. Dynamic Programming 5. Fast and Slow Pointers 6. Graph Traversal 7. Traversal in Linked List 8. K-way merge 9. Merge intervals 10. Modified Binary search 11. Sliding window 12. Top K elements 13. Topological Sorting 14. Tree BFS 15. Tree DFS 16. Two Pointers Below is a collection of key patterns and important LeetCode problems to practice. Based on my observation, anyone who sincerely solves these problems—not by simply memorizing code or patterns, but by truly understanding the logic, applying critical thinking, writing code from scratch, and learning how to adapt these concepts to new problems—will be well-equipped to clear most written tests and interview rounds for product-based companies in Data Structures and Algorithms (DSA). 1. Two Pointers: Pointers Running from both ends of an array i. https://leetcode.com/problems/trapping-rain-water/ ii. https://leetcode.com/problems/container-with-most-water/
iii. https://leetcode.com/problems/next-permutation/ iv. https://leetcode.com/problems/sort-array-by-parity-ii/ Slow & Fast Pointers i. https://leetcode.com/problems/palindrome-linked-list/ ii. https://leetcode.com/problems/circular-array-loop/ iii. https://leetcode.com/problems/moving-stones-until-consecutive-ii/ iv. https://leetcode.com/problems/remove-duplicates-from-sorted-list- ii/ v. https://leetcode.com/problems/longest-mountain-in-array/ Running from beginning of 2 arrays / Merging 2 arrays i. https://leetcode.com/problems/merge-sorted-array/ ii. https://leetcode.com/problems/intersection-of-two-arrays-ii/ iii. https://leetcode.com/problems/longest-uncommon-subsequence-ii/ iv. https://leetcode.com/problems/find-median-from-data-stream/ v. https://leetcode.com/problems/ways-to-split-array-into-three- subarrays/ Split & Merge of an array / Divide & Conquer i. https://leetcode.com/problems/partition-list/ ii. https://leetcode.com/problems/sort-list/ Credits: https://leetcode.com/discuss/post/1688903/solved-all-two- pointers-problems-in-100-z56cn/ 2. Sliding Window Technique: Fix Sized Window: i. https://leetcode.com/problems/find-all-anagrams-in-a- string/description/ ii. https://leetcode.com/problems/minimum-number-of-k-consecutive- bit-flips/solutions/5369471/Java-or-Sliding-Window-or-2-methods/ iii. https://leetcode.com/problems/number-of-sub-arrays-of-size-k-and- average-greater-than-or-equal-to- threshold/solutions/1772628/Java-or-Sliding-Window-template-or- Explained/
iv. https://leetcode.com/problems/substrings-of-size-three-with- distinct-characters/solutions/1772589/Java-or-Reuse-LC-1100/ v. https://leetcode.com/problems/alternating-groups- ii/solutions/6518631/reuse-lc-3206-sliding-window-template/ vi. https://leetcode.com/problems/reschedule-meetings-for-maximum- free-time-i/solutions/6941086/sliding-window-explained-by- prashant404-6lve/ Variable Sized Window: i. https://leetcode.com/problems/minimum-size-subarray- sum/solutions/1330024/Java-or-Sliding-Window-or-Time-beats- 100/ ii. https://leetcode.com/problems/number-of-subarrays-with-bounded- maximum/solutions/5399259/Java-or-Sliding-Window-or- Explained/ iii. https://leetcode.com/problems/max-consecutive-ones- iii/solutions/1774174/Java-or-Reuse-LC-487-or-Sliding-Window- or-Explained/ iv. https://leetcode.com/problems/longest-continuous-subarray-with- absolute-diff-less-than-or-equal-to-limit/solutions/5359438/java-2- methods-explained/ v. https://leetcode.com/problems/maximum-erasure- value/solutions/2141049/Java-or-Sliding-Window-or-Reuse-LC-3/ vi. https://leetcode.com/problems/maximize-the-confusion-of-an- exam/solutions/3729631/Java-or-Sliding-Window-Template-or- Explained/ vii. https://leetcode.com/problems/count-the-number-of-good- subarrays/solutions/6657995/sliding-window-template-explained- by-pra-0uta/ viii. https://leetcode.com/problems/shortest-subarray-with-or-at-least-k- ii/solutions/6058352/reuse-lc-3095-explained/ ix. https://leetcode.com/problems/count-of-substrings-containing- every-vowel-and-k-consonants-ii/solutions/6521922/sliding- window-template-explained-by-pra-jvbx/ x. https://leetcode.com/discuss/post/6364043/master-dsa-patterns-by- anonymous_user-2rjo/

Tài liệu liên quan

x
Báo cáo lỗi download
Nội dung báo cáo



Chất lượng file Download bị lỗi:
Họ tên:
Email:
Bình luận
Trong quá trình tải gặp lỗi, sự cố,.. hoặc có thắc mắc gì vui lòng để lại bình luận dưới đây. Xin cảm ơn.