Reversing a string is easily done by putting its characters in a:
AString
BStruct
CStack
DStream
Answer & Solution
Correct answer: C. Stack
1. Reversal needs the last character to come out first.
2. One structure gives exactly that order for free.
3. Reversing a string is easily done by putting the characters of a string in a stack.
4. So the answer is a stack.
_Source: syllabus Computer Science, Ch 3 'Stack' and Ch 4 'Queue'_
Keep practising Stacks and Queues
Browse all Stacks and Queues questions for IGNOU MCA, or explore more Computer Science topics.