-
Maximum Size Sub Matrix With All 1s In A Binary Matrix
```java void printMaxSubSquare(int M[][]) { int i,j; int R = M.length; int C = M[0].length; int S[][] = new int[R][C];
-
Maximum Size Rectangle Binary Sub Matrix 1s
```c++
-
Largest Rectangular Area In A Histogram
int largestRectangleArea(vector<int> &height) { int res = 0; for (int i = 0; i < height.size(); ++i) { if (i + 1 < height.size() && height[i] <= height[i + 1]) { continue; } int minH = height[i]; for (int j = i; j >= 0; --j) { minH = min(minH, height[j]); int area = minH * (i - j + 1); res = max(res, area); } } return res; }
-
Implement Reverse DNS Look Up Cache
```c #include
#include #include -
Implement Forward DNS Look Up Cache
```c #include
#include #include -
Given an array arr[], find the maximum j – i such that arr[j] > arr[i]
```java int max(int x, int y) { return x > y ? x : y; }
-
Design a data structure for LRU Cache
```java
-
Latent Dirichlet allocation
- α is the parameter of the Dirichlet prior on the per-document topic distributions,
- β is the parameter of the Dirichlet prior on the per-topic word distribution,
- is the topic distribution for document i,
- is the word distribution for topic k,
- is the topic for the j-th word in document i, and
- is the specific word.
-
Huffman Coding Greedy Algo
```java class HuffmanNode {
-
Root to leaf path sum equal to a given number
```java