Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

Tuesday common C++ interview problem: Calculate h-index. Given information about research paper citations as std::vector<int>, where each element represents the number of citations for a paper, calculate the h-index: https://lnkd.in/eBZrC3ku. Your solution should run in O(n). Solve it yourself: https://lnkd.in/epkSkbc8 Solution: https://lnkd.in/e6pyx2hv #cpp #cplusplus #coding #programming #dailybiteofcpp

  • No alternative text description for this image
Krish Patel

NC State Student Government1K followers

2y

Cool solution. I always approached this problem by binary searching over a fixed range to determine the h index.

Karl C.

Jane Street369 followers

2y

Might also be possible to this in O(n) time O(1) memory if the array is allowed to be modified

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories