FliQi Education App Download
प्रश्न-बैंक · DSA

Stack — प्रश्न और उत्तर

DSA · 39 जाँचे हुए (verified) प्रश्न

  • 39 जाँचे हुए प्रश्न
  • हिंदी + English

पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।

भाषा
प्रश्न 1उत्तर + हल
यदि किसी स्टैक का आकार पाँच है और उसमें पहले से पाँच एलिमेंट भरे हैं, तब एक और एलिमेंट PUSH करने पर स्टैक की स्थिति क्या बनेगी?
If a user PUSHes one more element into a stack that already holds five elements and whose size is five, then the stack becomes
  1. Aओवरफ़्लो (overflow)overflow
  2. Bअंडरफ़्लो (underflow)underflow
  3. Cयूज़र फ़्लो (user flow)user flow
  4. Dक्रैश (crash)crash

सही उत्तर / Answer: (A)

हल / Solution
ऐरे से बने स्टैक की क्षमता पहले से तय रहती है। यहाँ आकार पाँच है और पाँचों जगह भरी हैं, इसलिए छठा एलिमेंट रखने की जगह बची ही नहीं। इस स्थिति को स्टैक ओवरफ़्लो कहते हैं और PUSH से पहले यही जाँच की जाती है। अंडरफ़्लो इसका उलटा है, जो ख़ाली स्टैक पर POP करने से बनता है। 'यूज़र फ़्लो' कोई तकनीकी शब्द नहीं है, और क्रैश इसका नतीजा हो सकता है, नाम नहीं।
A stack built on an array has a fixed capacity. Here the size is five and all five slots are already filled, so no room is left for a sixth element. This state is called stack overflow, and a program checks for it before every PUSH. Underflow is the opposite case and arises when POP is used on an empty stack. User flow is not a technical term, and a crash is a result, not a name.
प्रश्न 2उत्तर + हल
इन्फ़िक्स व्यंजक को प्रभावी ढंग से पोस्टफ़िक्स रूप में बदलने के लिए निम्न में से क्या आवश्यक है?
Which of the following is essential for converting an infix expression to the postfix form efficiently?
  1. Aएक ऑपरेटर स्टैक (operator stack)An operator stack
  2. Bएक ऑपरेंड स्टैक (operand stack)An operand stack
  3. Cएक ऑपरेंड स्टैक और एक ऑपरेटर स्टैकAn operand stack and an operator stack
  4. Dएक पार्स ट्री (parse tree)A parse tree

सही उत्तर / Answer: (A)

हल / Solution
इन्फ़िक्स से पोस्टफ़िक्स बनाने में ऑपरेंड पढ़ते ही सीधे आउटपुट में लिख दिए जाते हैं, उन्हें कहीं रोकना नहीं पड़ता। रोकना सिर्फ़ ऑपरेटर और कोष्ठक को पड़ता है, इसलिए केवल एक ऑपरेटर स्टैक चाहिए — यही शंटिंग यार्ड (Shunting Yard) विधि है। ऑपरेंड स्टैक की ज़रूरत तब पड़ती है जब पोस्टफ़िक्स का मान निकालना हो, बदलने में नहीं। दोनों स्टैक रखना फ़ालतू है और पार्स ट्री भारी तरीक़ा है।
While converting infix to postfix, every operand is written straight to the output as soon as it is read, so it never has to be held anywhere. Only operators and brackets need to be held back, so a single operator stack is enough, and that is how the Shunting Yard method works. An operand stack is needed when a postfix expression is evaluated, not during conversion. Keeping both stacks is wasteful, and a parse tree is a heavier tool.
प्रश्न 3उत्तर + हल
इन्फ़िक्स नोटेशन को पोस्टफ़िक्स नोटेशन में बदलने के लिए किस डेटा संरचना की ज़रूरत होती है?
Which data structure is needed to convert infix notation to postfix notation?
  1. Aब्रांच (branch)branch
  2. Bक्यू (queue)queue
  3. Cट्री (tree)tree
  4. Dस्टैक (stack)stack

सही उत्तर / Answer: (D)

हल / Solution
इन्फ़िक्स को पोस्टफ़िक्स में बदलते समय ऑपरेंड सीधे आउटपुट में चले जाते हैं, पर ऑपरेटर और कोष्ठक को उनकी प्राथमिकता (precedence) के हिसाब से रोककर रखना पड़ता है। यह रुका हुआ ऑपरेटर उलटे क्रम में बाहर आता है, इसलिए स्टैक (stack) ही चाहिए। क्यू फ़ीफ़ो क्रम देती है, जो प्राथमिकता सँभाल नहीं सकती। ट्री से भी हो सकता है पर वह लंबा रास्ता है, और ब्रांच कोई डेटा संरचना ही नहीं है।
While converting infix to postfix, the operands go straight to the output, but the operators and brackets must be held back and released according to their precedence. These held operators come out in reverse order of arrival, which is why a stack is needed. A queue gives First In First Out order and cannot handle precedence. A tree can do the job but takes a longer route, and branch is not a data structure at all.
प्रश्न 4उत्तर + हल
प्रिफ़िक्स (prefix) से पोस्टफ़िक्स (postfix) में बदलना किस डेटा संरचना से संभव है?
Prefix to postfix conversion is possible using which data structure?
  1. Aस्टैक (Stack)Stack
  2. Bक्यू (Queue)Queue
  3. Cलिंक्ड लिस्ट (Linked List)Linked List
  4. Dट्री (Tree)Tree

सही उत्तर / Answer: (A)

हल / Solution
प्रिफ़िक्स को पोस्टफ़िक्स में बदलने के लिए व्यंजक को दाएँ से बाएँ पढ़ा जाता है और हर ऑपरेटर मिलने पर दो ऑपरेंड निकालकर नया टुकड़ा बनाकर वापस रखा जाता है। यह 'आख़िरी रखा, पहले निकला' वाला काम स्टैक (Stack) ही सहजता से करता है। क्यू फ़ीफ़ो (First In First Out) है, इसलिए उलटे क्रम में टुकड़े नहीं लौटा सकती। लिंक्ड लिस्ट केवल भंडारण का तरीक़ा है और एक्सप्रेशन ट्री लंबा रास्ता है, सीधा उपाय स्टैक है।
To change a prefix expression into postfix form, the expression is scanned from right to left, and on each operator two operands are pulled out and a new piece is put back. This last in, first out handling is exactly what a stack does naturally. A queue follows First In First Out, so it cannot return pieces in reverse order. A linked list only stores data, and an expression tree is a longer route.
प्रश्न 5उत्तर + हल
'पुश' (push) और 'पॉप' (pop) शब्द किससे संबंधित हैं?
The terms 'push' and 'pop' are related to
  1. Aऐरे (array)array
  2. Bसूचियाँ (lists)lists
  3. Cस्टैक (stacks)stacks
  4. Dये सभीAll of these

सही उत्तर / Answer: (C)

हल / Solution
पुश और पॉप स्टैक के अपने दो ऑपरेशन हैं। पुश शीर्ष (Top) पर नया एलिमेंट रखता है और पॉप वहीं से एलिमेंट हटाता है, जिससे लिफ़ो (Last In First Out) क्रम बनता है। ऐरे में डेटा जोड़ने-हटाने के लिए इंसर्ट और डिलीट कहा जाता है और वहाँ किसी भी स्थान पर काम हो सकता है। सूचियों में एपेंड या रिमूव जैसे शब्द चलते हैं। इसलिए 'ये सभी' ग़लत है।
Push and pop are the two operations that belong to a stack. Push places a new element on the top and pop removes an element from the same end, which creates the Last In First Out order. In an array the words used are insert and delete, and work can be done at any index. Lists normally use words like append or remove. So the option saying all of these is wrong.
प्रश्न 6उत्तर + हल
यदि स्टैक ख़ाली है, तो POP करने पर स्टैक की स्थिति क्या होगी?
If a stack is empty, then after POP the stack would be in a state of
  1. Aअंडरफ़्लो (underflow)underflow
  2. Bओवरफ़्लो (overflow)overflow
  3. Cडिलीट (delete)delete
  4. Dइंसर्ट (insert)insert

सही उत्तर / Answer: (A)

हल / Solution
ख़ाली स्टैक पर POP चलाने का मतलब है वहाँ से कुछ निकालना जहाँ कुछ है ही नहीं। इस त्रुटि-स्थिति को स्टैक अंडरफ़्लो (underflow) कहते हैं, और अच्छा प्रोग्राम POP से पहले यही जाँचता है। ओवरफ़्लो इसका उलटा हाल है, जो भरे हुए स्टैक में PUSH करने पर बनता है। डिलीट और इंसर्ट केवल क्रियाओं के नाम हैं, किसी त्रुटि-स्थिति के नाम नहीं, इसलिए वे यहाँ सही नहीं बैठते।
Running POP on an empty stack means trying to take something out when nothing is there. This error state is called stack underflow, and a well written program checks for it before every POP. Overflow is the opposite situation and happens when PUSH is attempted on a stack that is already full. Delete and insert are only names of operations, not names of an error state, so they do not fit here.
प्रश्न 7उत्तर + हल
स्टैक से एलिमेंट हटाने की प्रक्रिया को क्या कहते हैं?
The process of removing an element from the stack is called
  1. Aक्रिएट (create)create
  2. Bडिलीट (delete)delete
  3. Cपुश (PUSH)PUSH
  4. Dपॉप (POP)POP

सही उत्तर / Answer: (D)

हल / Solution
स्टैक से एलिमेंट निकालने की क्रिया का तकनीकी नाम POP है। यह हमेशा शीर्ष (Top) से होता है, इसलिए सबसे बाद में डाला गया एलिमेंट सबसे पहले बाहर आता है। PUSH इसका उलटा काम करता है, वह शीर्ष पर नया एलिमेंट रखता है। क्रिएट से नया स्टैक बनाया जाता है। डिलीट एक आम शब्द है जो ऐरे या सूची में चलता है, पर स्टैक में इसी क्रिया का पक्का नाम POP ही है।
The technical name for taking an element out of a stack is POP. It always works at the top, so the element inserted last is the one that leaves first. PUSH does the opposite job and places a new element on the top. Create is used for setting up a new stack. Delete is a general word used with arrays and lists, but in a stack the proper name for this operation is POP.
प्रश्न 8उत्तर + हल
स्टैक में एक एलिमेंट डालने की प्रक्रिया को क्या कहा जाता है?
In the stack, the process of inserting an element in the stack is called
  1. Aपॉप (POP)POP
  2. Bक्रिएट (create)create
  3. Cमूल्यांकन (evaluation)evaluation
  4. Dपुश (PUSH)PUSH

सही उत्तर / Answer: (D)

हल / Solution
स्टैक के शीर्ष (Top) पर नया एलिमेंट रखने की क्रिया को PUSH कहते हैं। हर PUSH के बाद शीर्ष एक जगह ऊपर खिसक जाता है, इसलिए जो एलिमेंट सबसे बाद में डाला गया वही सबसे ऊपर रहता है — यही लिफ़ो (Last In First Out) नियम है। POP इसका उलटा है, वह एलिमेंट हटाता है। क्रिएट से नई संरचना बनती है और मूल्यांकन (evaluation) किसी व्यंजक का मान निकालने की प्रक्रिया है, डालने की नहीं।
Placing a new element on the top of a stack is called PUSH. After every PUSH the top moves up by one position, so the element inserted last always stays on top, which is the Last In First Out rule. POP does the opposite and removes an element. The word create refers to setting up a new structure, and evaluation means finding the value of an expression, so neither of them describes insertion into a stack.
प्रश्न 9उत्तर + हल
निम्नलिखित में से कौन-सा शब्द स्टैक (Stack) से संबंधित है?
Which of the following terms is related to the stack?
  1. Aटॉप (TOP)TOP
  2. Bपुश (PUSH)PUSH
  3. Cपॉप (POP)POP
  4. Dकेवल (a), (b) और (c)Only (a), (b) and (c)

सही उत्तर / Answer: (D)

हल / Solution
स्टैक एक रैखिक डेटा संरचना है जो लिफ़ो (Last In First Out, LIFO) नियम से चलती है। इसके तीनों शब्द इसी से जुड़े हैं। TOP वह सूचक (pointer) है जो सबसे ऊपरी एलिमेंट की जगह बताता है। PUSH उसी शीर्ष पर नया एलिमेंट रखने की क्रिया है और POP शीर्ष से एलिमेंट हटाने की। तीनों अलग-अलग सही हैं, इसलिए किसी एक को चुनना अधूरा होगा और चौथा विकल्प ही पूरा उत्तर है।
A stack is a linear data structure that follows the Last In First Out rule, and all three terms belong to it. TOP is the pointer that marks the position of the uppermost element. PUSH is the operation that places a new element on that top, and POP is the operation that removes an element from it. Since each term is correct on its own, picking only one would be incomplete, so the fourth option is the full answer.
प्रश्न 10उत्तर + हल
एक स्टैक (Stack) में किन निर्देशों का उपयोग किया जाता है?
In a stack, which instructions are used?
  1. Aपुश (PUSH)PUSH
  2. Bपॉप (POP)POP
  3. Cपुश, पॉप (PUSH, POP)PUSH, POP
  4. Dपुश, आउट (PUSH, OUT)PUSH, OUT

सही उत्तर / Answer: (C)

हल / Solution
स्टैक (Stack) पर दो ही बुनियादी निर्देश चलते हैं। नया डेटा सबसे ऊपर रखने को PUSH कहते हैं और सबसे ऊपर रखा डेटा निकालने को POP। दोनों काम एक ही सिरे यानी शीर्ष (Top) से होते हैं, इसीलिए स्टैक लिफ़ो (Last In First Out, LIFO) नियम से चलता है। अकेला PUSH या अकेला POP अधूरा उत्तर है, क्योंकि प्रश्न दोनों निर्देश माँग रहा है। OUT नाम का कोई निर्देश स्टैक में होता ही नहीं, इसलिए चौथा विकल्प ग़लत है।
A stack works with just two basic instructions. PUSH puts a new item on the top, and POP takes the topmost item out. Both act on the same end, the top, which is why a stack follows the Last In First Out (LIFO) rule. PUSH alone or POP alone is only half the answer, because the question asks for the instructions a stack uses. OUT is not a stack instruction at all, so the last option is wrong.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
स्टैक (stack) किसे लागू करने में उपयोगी है?
A stack is useful for implementing
  1. Aब्रेड्थ फ़र्स्ट सर्च (breadth first search)Breadth first search
  2. Bरिकर्सन (recursion)Recursion
  3. Cडेप्थ फ़र्स्ट सर्च (depth first search)Depth first search
  4. Dदूसरा और तीसरा, दोनोंBoth (b) and (c)
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 12उत्तर app में
स्टैक (stack) को और किस नाम से जाना जाता है?
A stack is also called
  1. Aफ़र्स्ट-इन फ़र्स्ट-आउट (FIFO)First-In First-Out (FIFO)
  2. Bलास्ट-इन फ़र्स्ट-आउट (LIFO)Last-In First-Out (LIFO)
  3. Cलास्ट-इन लास्ट-आउट (LILO)Last-In Last-Out (LILO)
  4. Dफ़र्स्ट-कम फ़र्स्ट-सर्व्ड (FCFS)First-Come First-Served (FCFS)
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 13उत्तर app में
स्टैक (stack) क्या है?
A stack is
  1. Aएक अमूर्त डेटा संरचना (abstract data structure)Abstract data structure
  2. Bलगातार बदलती वस्तुConstantly changing object
  3. Cवस्तुओं का एक क्रमित संग्रहAn ordered collection of items
  4. Dउपर्युक्त सभीAll of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
स्टैक को कभी-कभी क्या कहा जाता है?
Stack is sometimes called a
  1. Apush down stack / पुश डाउन स्टैकpush down stack
  2. Bpush down array / पुश डाउन ऐरेpush down array
  3. Cpop down stack / पॉप डाउन स्टैकpop down stack
  4. Dpop up array / पॉप अप ऐरेpop up array
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
डेटा आइटम्स की ऐसी सूची, जो आमतौर पर शब्दों या बाइट्स की होती है और जिसमें तत्व सिर्फ़ एक ही छोर से जोड़े या हटाए जा सकते हैं, कहलाती है
A list of data items, usually words or bytes, with the accessing restriction that elements can be added or removed at one end of the list only, is called
  1. Astack / स्टैकstack
  2. Bmemory / स्मृतिmemory
  3. Clinked list / लिंक्ड लिस्टlinked list
  4. Dheap / हीपheap
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 17उत्तर app में
इनफ़िक्स व्यंजक के मूल्यांकन वाली एल्गोरिदम के बारे में निम्नलिखित में से कौन-सा कथन ग़लत है?
Which of the following statements is incorrect with respect to the evaluation of an infix expression algorithm?
  1. Aऑपरेंड को स्टैक पर push किया जाता हैOperand is pushed on to the stack
  2. Bयदि ऑपरेटर की प्राथमिकता अधिक हो, तो दो ऑपरेंड pop करके मूल्यांकन करेंIf the precedence of operator is higher, pop two operands and evaluate
  3. Cयदि ऑपरेटर की प्राथमिकता कम हो, तो दो ऑपरेंड pop करके मूल्यांकन करेंIf the precedence of operator is lower, pop two operands and evaluate
  4. Dपरिणाम को ऑपरेंड स्टैक पर push किया जाता हैThe result is pushed on to the operand stack
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 18उत्तर app में
प्रीफ़िक्स (prefix) व्यंजक का मूल्यांकन करते समय स्ट्रिंग को किस दिशा में पढ़ा जाता है?
While evaluating a prefix expression, the string is read from?
  1. Aबाएँ से दाएँleft to right
  2. Bदाएँ से बाएँright to left
  3. Cमध्य से दाएँcenter to right
  4. Dमध्य से बाएँ, फिर दाएँcenter to left to right
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 19उत्तर app में
निम्नलिखित इनफ़िक्स व्यंजक का मान विधि से निकालिए और सही उत्तर चुनिए। a+b*c-d/e^f, जहाँ a=1, b=2, c=3, d=4, e=2, f=2 है।
Evaluate the following infix expression using the algorithm and choose the correct answer. a+b*c-d/e^f where a=1, b=2, c=3, d=4, e=2, f=2.
  1. A6
  2. B8
  3. C9
  4. D7
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 21उत्तर app में
इनफ़िक्स मूल्यांकन विधि से निम्नलिखित व्यंजक का मान निकालिए और सही उत्तर चुनिए। 4*2+3-5/5
Evaluate the following expression using the infix evaluation algorithm and choose the correct answer. 4*2+3-5/5
  1. A10
  2. B11
  3. C16
  4. D12
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
इनफ़िक्स (infix) व्यंजक के मूल्यांकन वाली विधि लागू करने के लिए कितने ढेर (stack) चाहिए?
How many stacks are required for applying evaluation of infix expression algorithm?
  1. AएकOne
  2. BदोTwo
  3. CतीनThree
  4. DचारFour
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 24उत्तर app में
इन फलनों (functions) पर विचार कीजिए:
push() : ढेर (stack) में एक element डालता है
pop() : ढेर के सबसे ऊपर वाला element निकालता है
top() : सबसे ऊपर वाले node में रखा मान लौटाता है
नीचे दिए क्रम में ये संक्रियाएँ करने पर output क्या होगा?
push(20);
push(4);
top();
pop();
pop();
pop();
push(5);
top();
Consider these functions:
push() : push an element into the stack
pop() : pop the top-of-the-stack element
top() : returns the item stored in top-of-the-stack node
What will be the output after performing this sequence of operations?
push(20);
push(4);
top();
pop();
pop();
pop();
push(5);
top();
  1. A20
  2. B4
  3. Cस्टैक अंडरफ़्लो (stack underflow)stack underflow
  4. D5
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 25उत्तर app में
यदि तत्व A, B, C और D को इसी क्रम में एक ढेर (stack) में रखा जाए और फिर एक-एक करके हटाया जाए, तो हटने का क्रम क्या होगा?
If the elements A, B, C and D are placed in a stack and are deleted one at a time, what is the order of removal?
  1. AABCD
  2. BDCBA
  3. CDCAB
  4. DABDC
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 26उत्तर app में
किस प्रकार के व्यंजक में ऑपरेटर अपने ऑपरेंड के बाद आता है?
The type of expression in which the operator succeeds its operands is?
  1. Aइनफ़िक्स व्यंजकInfix Expression
  2. Bप्रीफ़िक्स व्यंजकPrefix Expression
  3. Cपोस्टफ़िक्स व्यंजकPostfix Expression
  4. Dप्रीफ़िक्स और पोस्टफ़िक्स दोनोंBoth Prefix and Postfix Expressions
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 27उत्तर app में
निम्नलिखित में से कौन स्टैक का अंतर्निहित अनुप्रयोग नहीं है?
Which of the following is not an inherent application of stack?
  1. Aस्ट्रिंग को उलटनाReversing a string
  2. Bपोस्टफ़िक्स व्यंजक का मूल्यांकनEvaluation of postfix expression
  3. Cरिकर्सन को लागू करनाImplementation of recursion
  4. Dजॉब शेड्यूलिंगJob scheduling
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 28उत्तर app में
आकार 5 के एक स्टैक पर निम्नलिखित क्रियाएँ की जाती हैं।
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
सभी क्रियाएँ पूरी होने के बाद स्टैक में कितने तत्व बचेंगे?
Consider the following operations performed on a stack of size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operations, the number of elements present in the stack is?
  1. A1
  2. B2
  3. C3
  4. D4
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 29उत्तर app में
स्टैक डेटा संरचना के बारे में निम्नलिखित में से कौन-सा कथन सही नहीं है?
Which of the following statements about the stack data structure is NOT correct?
  1. Aस्टैक बनाने के लिए लिंक्ड लिस्ट का उपयोग होता हैLinked lists are used for implementing stacks
  2. Bस्टैक का top हमेशा नया नोड रखता हैTop of the stack always contains the new node
  3. Cस्टैक एक FIFO डेटा संरचना हैStack is the FIFO data structure
  4. Dस्टैक के सबसे नीचे वाले अंतिम नोड में null लिंक होता हैNull link is present in the last node at the bottom of the stack
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
Stack के सभी 39 प्रश्न — उत्तर, हल और अभ्यास

FliQi Question Bank app में topic-वार अभ्यास, कठिनाई-स्तर और आपकी प्रगति।

  • पहला test मुफ़्त
  • हिंदी + English
  • जाँचे हुए उत्तर और हल

यह topic किन परीक्षाओं में आता है

DSA के दूसरे topics

सभी topics