+1 vote
in Data Structures & Algorithms I by (110k points)
Given only a single array of size 10 and no other memory is available. Which of the following operation is not feasible to implement (Given only push and pop operation)?

(a) Push

(b) Pop

(c) Enqueue

(d) Returntop

Query is from Queue using Stacks topic in portion Abstract Data Types of Data Structures & Algorithms I

I have been asked this question in an interview for internship.

1 Answer

+1 vote
by (408k points)
selected by
 
Best answer
Right choice is (c) Enqueue

The best explanation: To perform Enqueue using just push and pop operations, there is a need of another array of same size. But as there is no extra available memeory, the given operation is not feasible.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...