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

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

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

1 Answers
Admin Staff answered 4 years ago

a) (n-1) / 2