Categories
Algorithms

Union-Find (aka Disjoint Set) Data Structure

Very quick summary of Union-Find or Disjoint Set data structure

Categories
Algorithms

LeetCode: Find Peak Element Solution

The Find Peak Element problem can be solved using a linear search in O(n) time and O(1) space. but it can be even better to solve it by binary search in O(log n) time complexity. But there can be two cases for binary search solution, the recursive solution creates stacks for each call and thus […]