dsa1 min read
K-th Smallest Prime Fraction — Binary Search on Value
Find the kth smallest prime fraction from an array using binary search on the fraction value with a counting function.
Read →
webcoderspeed.com
1276 articles
Find the kth smallest prime fraction from an array using binary search on the fraction value with a counting function.
Check if any element and its double both exist in an array using a hash set or sorting with binary search.
Implement get(key, timestamp) using binary search on stored sorted timestamps for O(log n) retrieval.
Maximize events attended by greedily attending the event with the earliest end date each day using binary search.
Find the kth smallest element from two sorted arrays in O(log(m+n)) using binary elimination of k/2 elements per step.