a.k.a my learning journal.
Scale from Zero to Million Users
- SOLID Principles
- is-a vs has-a relationship
- Composition vs Aggregation
- Why do we need design patterns
- Strategy Design Pattern
- Observer Design Pattern
- Decorator Design Pattern
- Factory Design Pattern
In Java, things are strictly Pass By Value
(for objects, Pass BY VALUE occurs and it means that REFERENCE is passed as VALUE.)
Pass By Reference :
Scenario --- If teacher has given his original class notes doc to a student,
any changes he makes there will reflect in others who have the sheet.
Pass By Value :
Scenario --- If teacher has given his printout of Original class notes doc to a student,
any changes he makes there will reflect in others who have the sheet.
Pass By Reference, happens in C with the help of pointers.
- Auxiliary space complexity : refers to the extra space or memory required by an algorithm apart from the input size.
- To reduce the size of number to fit the integer bit range, we use number % MOD where mod = (int) 1e9 + 7;
Integer.MAX_VALUE -> (2^31-1 = 2147483647)
Integer.MIN_VALUE -> (-2^31 = -2147483648)
- Combination Formula
n = total number of items
r = items chosen at a time
- Permutation Formula
n = total number of items
r = items chosen at a time
Divide and Conquer
Backtracking
- Understand this pattern
- Combination Sum 1
- Subset Sum 1
Generic Recursion
Easy Wins
- Remove Duplicates From Sorted Array
- Remove-elements
- Palindrome-With-And-Without-Converting-To-String
- Search-insert-position
Famous Problems / One-Ofs
- Sort Arrays of 0s, 1s and 2s
- Stock Buy and Sell
- Next Permutation
- Pascal's Traingle
- Count reverse pairs
- Count inversions
- Find the Union
Longest Subarray / Maximum Subarray
- Longest subarray with given sum K(positives)
- Longest subarray with sum K (Positives + Negatives)
- Longest Consecutive Sequence In An Array
- Find maximum sum for subarray
Matrix Related
Sorting
- Largest Element in an Array
- Check if the array is sorted
- Check if array is sorted and rotated
- Remove duplicates from Sorted array (in-place)
- Second-Largest Element in an Array without sorting
Array Rotation
- Left Rotate an array by one place
- Left rotate an array by D places
Rearranging Elements
- Move Zeros to end
- Rearrange elements by sign
Searching / Finding certain elements or patterns
- Linear Search
- Maximum Consecutive Ones
- Find the number that appears once, and other numbers twice.
- Find missing number in an array
- Find-the-repeating-and-missing-numbers
- Leaders in an array
- two-sum-check-if-a-pair-with-given-sum-exists-in-array
- union-of-two-sorted-arrays
- 3-sum-find-triplets-that-add-up-to-a-zero
- 4sum
- Container with most water (two pointer / greedy)
- [Subset Sum](theory/dsa/Dynamic Programming/SubSetSum.md)
- [Equal Sum Partition](theory/dsa/Dynamic Programming/EqualSumPartitionProblem.md)
- [Count of Subset Sum](theory/dsa/Dynamic Programming/CountNumberOfSubsets.md)
- [Minimum Subset Sum Diff.](theory/dsa/Dynamic Programming/Minimum_Difference_Partition.md)
- Target Sum
* [base 2 and base 10 conversion of a number]()
* 1s and 2s Compliment
* Must know tricks in Bit Manipulation
* Minimum Bit Flips to convert number
* Power Set
* Single Number 1
* Single Number 2
* Single Number 3
* XOR of numbers of given range
* Divide two integers without using multiplication and division operators
- [v2](resumes/Ashutosh Roy.pdf)
- [v1](resumes/Self Resume v1.pdf)