पहले 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
Aओवरफ़्लो (overflow)overflow
Bअंडरफ़्लो (underflow)underflow
Cयूज़र फ़्लो (user flow)user flow
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?
Cएक ऑपरेंड स्टैक और एक ऑपरेटर स्टैकAn operand stack and an operator stack
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?
Aब्रांच (branch)branch
Bक्यू (queue)queue
Cट्री (tree)tree
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?
Aस्टैक (Stack)Stack
Bक्यू (Queue)Queue
Cलिंक्ड लिस्ट (Linked List)Linked List
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
Aऐरे (array)array
Bसूचियाँ (lists)lists
Cस्टैक (stacks)stacks
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
Aअंडरफ़्लो (underflow)underflow
Bओवरफ़्लो (overflow)overflow
Cडिलीट (delete)delete
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
Aक्रिएट (create)create
Bडिलीट (delete)delete
Cपुश (PUSH)PUSH
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
Aपॉप (POP)POP
Bक्रिएट (create)create
Cमूल्यांकन (evaluation)evaluation
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?
Aटॉप (TOP)TOP
Bपुश (PUSH)PUSH
Cपॉप (POP)POP
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?
Aपुश (PUSH)PUSH
Bपॉप (POP)POP
Cपुश, पॉप (PUSH, POP)PUSH, POP
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 — अभ्यास, हल और आपकी प्रगति
डेटा आइटम्स की ऐसी सूची, जो आमतौर पर शब्दों या बाइट्स की होती है और जिसमें तत्व सिर्फ़ एक ही छोर से जोड़े या हटाए जा सकते हैं, कहलाती है
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
इन फलनों (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();
आकार 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?