GATE CS 2024 · Set-2 · Arrays & Matrix Representation

NAT · 1 mark · Problem PROG-DSTR-0089

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

Numerical answer (NAT).

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: [3.0, 3.0].See full step-by-step discussion on GateOverflow: https://gateoverflow.in/422872/gate-cse-2024-set-2-question-25

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com