I discussed and gave a sorting approach in time complexity O(N^2) to solve the 3sum problem without using set to filter out repeated triplets at the end. Approach based on hash is discussed too and several difficulties and concerns as well as solutions are raised up.

Read More
So here in this post, I relax the assumption of two sum problem even more by considering duplicates in the input. I give a pre-processing approach and show the worst time complexity would be O(N^2) and there might not be any better bound.

Read More
More analysis about two sum problem to find all possible solutions rather than unique solution is discussed. No duplicate is still assumed, and duplicates will be handled in a third post.

Read More
We analyze how to solve the classic two sum problem under the assumption that there is only one unique solution: 1) using sort and head/tail pointers with O(NlogN) time complexity 2) using hash table with O(N) time complexity. Further analysis about duplicates in the input would be discussed in later posts and this one could be a good recap or preparation for that.

Read More
This is a summary of all different solutions to the backwash problem within the percolation simulation including: 1) Associate each component root with an additional information (Without 2 WQUUF); 2) using TWO Weighted Quick Union Union Find (WQUUF) objects.

Read More