/codingProblems

Data Structure & Algorithms Repository + Leetcode problems

Primary LanguageJava

codingProblems

About

This is a repository for organizing theory and problems for Computer Science Data Structures and Algorithms. Ideally upon completion, this would be a one stop, No-BS repo containing compacy theory, Essential questions, and their solutions. This repo is made because in my University DSA course, we weren't assigned any problems as homeworks and most books are mostly theory oriented with missing framework/little structure to see relevant information to solve questions specifically. I also noticed that while LC/Hackerrank are not the most beginner friendly, and miss the framework to guide a beginner from easy->medium->hard problems while building upon the knowledge from a level before.

Process:

The process to follow through with this repo is simple:

Part-1

  1. Select 2-3 topics
  2. ENGROSS the topics theory
  3. Do the essential questions

Repeat 2 and 3 for chosen topics concurrently until all the essential questions have been attempted Repeat the whole process until you've attempted all the essential questions

Part-II

Now, you'd have gained enough acumen to solve better problems, faster. Do the advanced problems in archieve in an intelligent, excel-powered ad-hoc way until nothing's left.

Essentials

For essentials, here's the structure.

  • Arrays: 60 questions

    • DP
    • Greedy
    • Divide and conquer
    • Matrix
    • Intervals
    • Others
  • Sorting/Searching: 20 Questions

    • Binary Search
    • Search in Rotated Arrays
  • Linked-Lists: 10 Questions

  • Stacks/Queues: 10 Questions

  • Strings: 10 Questions

  • Recursion: 10 Questions

  • Trees: 10 Questions

  • Graph-Search(BFS/DFS/A-Star): 10 Questions

  • Heaps: 10 Questions

  • Bit-Manipulation/Math: 10 Questions

Total around 160 Questions

Every problem has their problem number in the file name, and runtime complexity in the code comments. I'm also trying to generate another readme and repo to organize common problem patterns like sliding window and two pointers, so that each of these patterns and their problems could be organized better. These problems are taken from leetcode and hackerrank.

Archieve: Advanced Questions

These are psets from geeks4geeks and I solve them as time permit. Some of the questions are really good! However, some are ambiguous in wording and the repo isn't as organized as I'd like.

Archieve -> Psets:

In the basics repo, there's theory/visualizations and any problems are generally in the increasing order of difficulty in each pset. However, some psets are more rigorous than others (arrays: searching I is definitely harder than say Stacks - I). Usually, the first 30-40% are leetcode easies, followed my mostly leetcode mediums. Some are leetcode hard in between but I'm not one for spoilers. I'll try to make sure that each solution set has its own runtime complexity documented. I'll also try to find out that each problem also contain some requirement for time/space complexity. However, I don't promise that.

Tips:

  1. Maintain a google docs / excel spreadsheet to log problems, focustime, and result (bruteforce/optimized/fail) so you could revisit problems later
  2. Don't look at the solutions until you have failed on 2-3 separate occasions after devoting at-least 30 mins each
  3. Do timed revisions on failed/challenging problems you marked on the spreadsheet.
  4. Add next day's questions to spreadsheet.

Contact