>RunTimeFix
BookStudyPracticeInterviewsYouTubeCoursesAbout
Log inGet Started
Topics/Sorting & Frequency Arrays
beginner level

Sorting & Frequency Arrays

Quick Answer

What is Sorting & Frequency Arrays?

Sorting is the most common preprocessing step in competitive programming — it enables binary search, greedy algorithms, two pointers, and many optimization techniques. RunTimeFix covers std::sort with custom comparators and lambdas, the STL binary search functions (lower_bound, upper_bound, binary_search), unique for removing consecutive duplicates, next_permutation for generating permutations, and the frequency counting pattern using arrays and maps. Understanding when to sort — and what to sort by — is a skill that transforms how you approach problems.

  • sorting
  • std::sort
  • frequency array
  • lower_bound
  • upper_bound
  • next_permutation
  • custom comparator

Study Material for Sorting & Frequency Arrays

Ch 10: Sorting & Frequency Arrays

std::sort — The Workhorse · lower_bound & upper_bound — Binary Search in STL · binary_search — Boolean Existence Check · unique — Removing Consecutive Duplicates · next_permutation — Generating Permutations · Sorting Applications · Frequency Counting

Related Topics

AlgorithmsBinary SearchGreedy Algorithms
Was this helpful?

Published by RunTimeFix · Comprehensive guides for competitive programming

>RunTimeFix

Practical programming education. Books, videos, courses, and hands-on learning for competitive programming, DSA, and software engineering.

RunTimeFix

  • About
  • YouTube
  • Book
  • Study Library
  • Courses

Learn

  • Competitive Programming
  • DSA
  • Development
  • Databases

Legal

  • Privacy
  • Terms
  • Refund Policy

RunTimeFix — debug → solve → run

© 2026 RunTimeFix. All rights reserved.