Sereja and Sorting
Sereja has an array, which consists of N integers. Let the integers be denoted by a1, a2, ... aN. Sereja has just started learning about sorting. Sereja wrote a program, which takes input of an index idx and then sorts the elements of Sereja's array which satisfy { ai : idx ≤ i . Now, Sereja wants to solve the more interesting problem of sorting the original array. But, Sereja is not very keen
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start