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
We try to relate the solution to the problem of Successor with delete to Union-Find algorithm here and discuss how to relate them and make it more straightforward in the first place from two different angles: 1) Analyze it in recursive way and give informal proof; 2) Draw it out by hand.

Read More