GATE CS 2015 · Set-2 · Asymptotic Analysis & Recurrences

NAT · 2 marks · Problem PROG-DIVC-0103

A Young tableau is a 2D array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with \(\infty\), and hence there cannot be any entry to the right of, or below, a \(\infty\). The following Young tableau consists of unique entries.\[\begin{array}{|c|c|c|c|}\hline 1 & 2 & 5 & 14\\ \hline 3 & 4 & 6 & 23\\ \hline 10 & 12 & 18 & 25\\ \hline 31 & \infty & \infty & \infty\\ \hline \end{array}\]When an element is removed from a Young tableau, other elements should be moved into its place so that the resulting table is still a Young tableau (unfilled entries may be filled in with a \(\infty\)). The minimum number of entries (other than 1) to be shifted, to remove 1 from the given Young tableau is

Numerical answer (NAT).

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solution\[\boxed{\text{fill the hole with the smaller of its right and lower neighbours, and repeat}}\]Hole at \((1,1)\): right 2, below 3: move 2 left.Hole at \((1,2)\): right 5, below 4: move 4 up.Hole at \((2,2)\): right 6, below 12: move 6 left.Hole at \((2,3)\): right 23, below 18: move 18 up.Hole at \((3,3)\): right 25, below \(\infty\): move 25 left.Hole at \((3,4)\): nothing to the right, \(\infty\) below: fill with \(\infty\).Entries shifted: 2, 4, 6, 18, 25.Answer: 5

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