Skip to content
#

stl-algorithms

Here are 52 public repositories matching this topic...

You have N elements array but you are given that there are only K distinct values which have been repeated again and again in any order. For example N could be 1000 and K could be 10 means that the array contains only 10 values which are being duplicated anywhere in the array. Now you want to sort that array. You must have to give appropriate implementation using vector, map or set (libraries in STL) or anything you like. Your algorithm should take O(N log K) time instead of O(N log N). Drive time complexity. Given BST/RedBlak Tree LNR gives us the sorted order.

  • Updated May 7, 2020
  • C++

Improve this page

Add a description, image, and links to the stl-algorithms topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the stl-algorithms topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.