How many swaps are required for reversing an array having n elements where n is an even number?

Q & ACategory: Data StructureHow many swaps are required for reversing an array having n elements where n is an even number?
Admin Staff asked 4 years ago

How many swaps are required for reversing an array having n elements where n is an even number?
a) (n-1) / 2
b) n/2
c) (n/2) – 1
d) (n+1)/2

1 Answers
Admin Staff answered 4 years ago

b) n/2