GATE CS 2024 (Afternoon) — Question 35

AlgorithmsDynamic Programming InfrastructureNAT1 markMedium

Let \( A \) be an array containing integer values. The distance of \( A \) is defined as the minimum number of elements in \( A \) that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array [2, 5, 3, 1, 4, 2, 6] is ________.
Practise the full 2024-AN paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkIntroduction to Algorithms (CLRS)The standard reference behind most GATE algorithm questions.
Practise more on Dynamic Programming InfrastructureTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group