50+ Reverse a Word using Stack MCQs with FREE PDF

We have the best collection of the evaluation of a Reverse a Word using Stack MCQs and answer with FREE PDF. These Reverse a Word using Stack MCQs will help you to prepare for any competitive exams like: BCA, MCA, GATE, GRE, IES, PSC, UGC NET, DOEACC Exams at all levels – you just have to practice regularly.

Reverse a Word using Stack MCQs

1. Reversing a word using stack can be used to find if the given word is a palindrome or not.

a) True

b) False

Answer: True

2. Which is the most appropriate data structure for reversing a word?

a) queue

b) stack

c) tree

d) graph

Answer: stack

3. Operations required for reversing a word or a string using stack are push() and pop().

a) True

b) False

Answer: True

4. What is the time complexity of reversing a word using stack algorithm?

a) O (N log N)

b) O (N2)

c) O (N)

d) O (M log N)

Answer: O (N)

5. What will be the word obtained if the word “abbcabb” is reversed using a stack?

a) bbabbca

b) abbcabb

c) bbacbba

d) bbacabb

Answer: bbacbba

6. How many stacks are required for reversing a word algorithm?

a) one

b) two

c) three

d) four

Answer: one

7. What will be result if the given stack is popped?

Reverse a Word using Stack
50+ Reverse a Word using Stack MCQs with FREE PDF 2

a) pat

b) tap

c) atp

d) apt

Answer: tap

8. What will be output if the following sequence of operations are executed?

Push(a,s);
Push(b,s);
Pop(b);
Push(c,s);

a) abc

b) b

c) ac

d) acb

Answer: b

9. What are the set of functions that are to be executed to get the following output?

cat

a) push(c, s); push(a, s); push(t, s);

pop(s); pop(s); pop(s);

b) push(c,s); pop(s); push(a,s); pop(s);push(t,s);pop(s);

c) pop(c ); pop(a); pop(t);

d) push(c,s); push(a,s); pop(t);

Answer: push(c,s); pop(s); push(a,s); pop(s);push(t,s);pop(s);

10. Find the error (if any) in the following code snippet for pop operation.

void pop() //removing an element from a stack
{
     printf(“%s”, stack[top++]);
}

a) run time error

b) compile time error

c) pop operation is performed, but top moved in wrong direction

d) pop operation is performed properly

Answer: pop operation is performed, but top moved in wrong direction

Download PDF (Reverse a Word using Stack MCQs)

Comments