In an array of 2N elements that is both 2-ordered and 3-ordered, what is the…
2013
In an array of 2N elements that is both 2-ordered and 3-ordered, what is the maximum number of positions that an element can be from its position if the array were 1-ordered?
- A.
1
- B.
2
- C.
N/2
- D.
2N-1
Attempted by 652 students.
Show answer & explanation
Correct answer: A
In k-ordered arrays, an element can be at most k-1 positions away from its sorted index. For a 2-ordered array, this limit is 1. Being 3-ordered imposes a looser constraint, which does not override the stricter 2-ordered limit. Therefore, the maximum displacement is 1.