Quick Recap on Various Elementary Sorting

This is a quick recap on different elementary sorting including Bubble Sort, Selection Sort, Insertion Sort, Shell Sort, the main point here is to review them and explain why are we interested in each of them.
Read More

K Sum Problem Analysis: Recursive Implementation and Lower Bound

I give a recursive implementation for K sum, so any K Sum Problems (2sum, 3sum, 4sum, etc) could be solved by the same code in a consistent way. And the lower bound Ω(n^ceil(k/2)) of the K sum problem is also given here just for your information, which is quite theoretical and research oriented.
Read More

4Sum Problem Analysis: O(N^2) VS O(N^2logN) VS O(N^3)

I implemented and discussed the common approach which reduces 4sum to 3sum and then to 2sum with O(N^3) time. The hash based approach is also analyzed too and sophysicated details about implementation are given. Time complexity differs depending on the type of hash map we use, O(N^2logN) for tree ordered hash map, O(N^2) for unordered hash map.
Read More

3Sum Closest Problem Analysis

We discuss 3Sum Closest problem the solution to which turns out to be simplified in less than 20 lines and sorting method is adopted. One could treat this problem as a simple extended exercise for the 3sum problem.
Read More