Sorting

Learn sorting through core algorithm implementations, recursive variants and interview applications involving ordered data.

8 online
Overall Progress
PLUS – Videos, editorials, planner all in one place – Videos, editorials, personalised planner & TUFY all in one place to save your time.

Planly

Know more

Striver’s Sorting Sheet contains 20 coding problems. It retains the original 16-question selection and adds Selection Sort, Bubble Sort, Recursive Bubble Sort and Recursive Insertion Sort from the existing A2Z resources. The complete coverage includes basic algorithm implementations as well as problems that use sorting to organize values, merge results or count relationships.

Do not treat sorting as a complete answer whenever it appears in an approach. A sorted sequence still needs a justified merge, pointer movement or counting rule. The required output can also depend on original positions, duplicate values or stable tie handling. Check those requirements before changing the input or choosing a comparison.

Topics covered in this practice sheet

Selection and bubble sort make comparisons and swaps visible on small inputs. Insertion, merge and quick sort introduce different ways to build or divide ordered work. The recursive bubble and insertion variants belong after basic recursion is familiar. The application questions then combine ordering with interval rules, merging, counting and other requirements.

  • Selection, bubble, insertion, merge and quick sort implementations.
  • Recursive bubble and insertion sort after recursion foundations.
  • Sorting-based applications, including merging, intervals and counting.

Beginner lessons and prerequisites

Know array indexing, loops, comparisons, swaps and function calls. Review these programming basics first if they are unfamiliar. Recursive sorting also needs a base case and an understanding of where a waiting call resumes; that prerequisite should come before the recursive variants.

Know array indices, loops, swaps and the distinction between a value and a record’s sorting key. Be able to trace a small recursive call before implementing divide-and-conquer methods. Also understand extra working storage: writing results into the original array does not remove temporary buffers or waiting recursive calls from the space analysis.

  • Decide whether the desired order is nondecreasing, decreasing or based on another key.
  • Keep equal-key records identifiable when checking whether a method is stable.
  • Read whether the input may change and whether original positions must survive.