This class implements a QuickSort algorithm using Hoare Paritioning scheme. This partitionining scheme is slightly harder to implement but is more efficient than the Lamuto partitioning scheme. Avg Time-Complexity: O(nlogn) Worst Time-Complexity: O(n^2) Space complexity: O(1) Implementation in Java Unit Testing Now test a few cases and see if the implementation passes all of them […]

# Tag: algorithms

## Merge Sort (Draft)

First check out the problem description here on LeetCode. The Solution This is marked as a medium difficult problem. However if you know what in-order traversal does, it is a very simple problem. Here I just added a helper traverse() method. All the trick is done in the few lines inside the function. It checks […]

Quick introduction to basic Reinforcement Learning algorithms including Bellman Equation, Policy Iteration, Value Iteration, and Q-Learning

Random Projection is an interesting Dimensionality Reduction technique. You may choose to create a random projection for 1,2,3,..,n dimensional projections. Now how to tell which one is best? So you would need to calculate loss of data due to this reduction in data size. # data has this shape: row, col = 4898, 11 random_projection […]