dsa2 min read
Median of Two Sorted Arrays — Binary Search on Partition
Find the median of two sorted arrays in O(log(min(m,n))) by binary searching for the correct partition point.
Read →
webcoderspeed.com
4 articles
Find the median of two sorted arrays in O(log(min(m,n))) by binary searching for the correct partition point.
Find the kth smallest element from two sorted arrays in O(log(m+n)) using binary elimination of k/2 elements per step.
Solve partition backtracking problems: equal sum subset (NP-hard, backtrack with pruning) and k equal sum subsets.
Generate valid IP addresses from digit strings and all sentence segmentations with word break backtracking.