Skip to content

Conversation

@aparibocci
Copy link
Contributor

This PR aims to add an algorithm to identify the top k most frequent strings given a provided string list of elements.
To do this, the algorithm is using a max-heap implementation already existing in this repository.

Time complexity is O(n), where n is the number of words:

O(n) for building the max-heap
k*O(logn) for extracting the k most frequent strings

Copy link
Member

@StepfenShawn StepfenShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@StepfenShawn StepfenShawn merged commit ecc4507 into TheAlgorithms:master Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants