Data Structures
H-Index (Sorting Approach)
H-Index (LeetCode 274) via sorting: sort citations descending and find the largest i where citations[i] >= i+1. O(n log n), Python/Java/C++.
2 notes tagged
H-Index (LeetCode 274) via sorting: sort citations descending and find the largest i where citations[i] >= i+1. O(n log n), Python/Java/C++.
H-Index II (LeetCode 275): binary search on sorted citations to find the h-index in O(log n).