Skip to content

sanketpm7/problem-solving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I have linked the solutions to the problems I've solved.

Problems

Array

Array

TODO:

  • Transpose of matrix
  • Rotate Image
  • Maximum Value in increasing - decreasing array
  • Matrix Rotation in place
  • Celebrity Problem
  • Quicksort implementation - Kth smallest
  • Median of two sorted array
  • Maximum of all subarrays of size K

Sliding Window: Fixed

Sliding Window: Variable

Stack & Queue
Heap
Greedy
Bitwise
Linked List
Recursion & Backtracking

TODO:

Tree

Leetcode Tree Constructor

TODO:

  • [Siblings & Cousins]
  • [Burn a tree]
Trie
Dynamic Programming

Patterns

Mix DP

I. 2-DP::

II. 0/1 Knapsack

III. Unbounded Knapsack

IV. Subsequence - Substring

V Partition DP

Graphs

Graph I

No Questions Way
1. BFS - Implementation Queue + visited[]
2. DFS - Implementation Visited[]
3. Number of Provinces BFS - disconnected components
4. Number of Islands Modified Number of Provinces + 1-degree traversal up, right, down, left
5. Flood Fill Modified Traversal
6. Rotten Oranges Modified BFS - With a Time Counter
7. Detect cycle using BFS - Undirected Graph Neighbour is visted => Neighbour is current node's parent
8. Detect cycle using DFS - Undirected Graph Neighbour is visted => Neighbour is current node's parent
9. Detect cycle using DFS - Directed Graph visited[] + dfsVisited[] (backtracking) : tracks visited path
10. Topological Sort - DFS visited[] + stk.push(node) backtracking
11. Topological Sort - BFS - Kahn's Algorithm indegree[] , Kahn Algorithm
12. Detect cycle using DFS - Directed Graph indegree[] or Kahn Algorithm
13. Bipartite Graph - BFS color[], color[currNode] == color[neighbour]
14. Bipartite Graph - DFS color[], color[currNode] == color[neighbour]
15. Clone Graph DFS + Mapping GivenNode to ClonedNode

Graph II

Note: Shortest Path Question will require a distance[] for every problem

No Questions Way
1. Shortest Path - Non-Weighted + Undirected Graph BFS + parent[]
2. Shortest Path - Weighted + Directed Graph Topological Stack + parent[]
3. Shortest Path - Weighted Graph( UDG) Djikstra Algorithm
4. Shortest Path - In Binary Maze Djikstra Algorithm

TODO:

  • Templates
  1. Construct Graph from given edges
Design

About

Contains the some of the problems I've solved.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published