report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
Module Sorting

Sorting

Frequency: 10/10

Some points to note:

  • Use built-in sort function (for example std::sort in C++) instead of writing your own sort function.
  • Learn how to use custom comparator for sort function to sort user-defined data types (.i.e struct, class,etc) or to sort primary data types in a different way (for example, sort strings based on their last characters).
  • Using Counting sort may lower time complexity.

Resources

  • Digital Ocean: Using sort() in C++ std Library
  • Wikipedia: Counting sort
  • CPlusPlus: std::sort
  • Problems

    Points Sorting 1169 / 1204 800
    Brewing potion 980 / 1061 800
    Smallest possible 1060 / 1108 900
    Distance minimization 654 / 688 900
    Segment 611 / 648 900
    Cucumber 433 / 542 1000
    Maximum value arrangement 669 / 743 1100
    Buttons game 492 / 561 1100
    Building fence 272 / 447 1200
    Balance 176 / 263 1800

    Complete Search

    • Backtracking
    • Permutation

    Prefix sum

    • Introduction to Prefix sum
    • Difference array

    Sorting

    • Sorting