PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम Infix to Postfix Conversion using Stack Algorithm (स्टैक का उपयोग करके इनफिक्स से पोस्टफिक्स रूपांतरण की चरणबद्ध विधि) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।
Overview: Dijkstra's Shunting-Yard style Infix-to-Postfix algorithm scans left-to-right in O(n) time, sending operands straight to output while buffering operators and '(' on a Stack. Tie-breaking on equal precedence pops for left-associative operators (+, -, *, /) but pushes for right-associative exponentiation (^).
अध्याय सार: स्टैक द्वारा इनफिक्स से पोस्टफिक्स रूपांतरण (Shunting-Yard विधि) बाएं से दाएं O(n) समय में स्कैन करता है, जहाँ ऑपरेंड सीधे आउटपुट में जाते हैं और ऑपरेटर व '(' स्टैक पर रहते हैं। समान प्राथमिकता होने पर बाएं-सहचारी ऑपरेटर (+, -, *, /) पॉप किए जाते हैं, जबकि दाएं-सहचारी '^' को सीधे पुश किया जाता है।
Infix to Postfix Conversion using Stack Algorithm: Detailed Notes & Architecture (स्टैक का उपयोग करके इनफिक्स से पोस्टफिक्स रूपांतरण की चरणबद्ध विधि)
1. Stack Role & Operand Output Rule (स्टैक की भूमिका और ऑपरेंड आउटपुट नियम)
[EN] During Infix-to-Postfix conversion, the stack ONLY stores operators and opening parentheses '('—operands (variables or numbers) are NEVER pushed onto this operator stack and instead go immediately to the Postfix output string. Because every token enters and exits the stack at most once, total conversion takes O(n) time and O(n) auxiliary space.
[HI] इनफिक्स से पोस्टफिक्स रूपांतरण में स्टैक के अंदर केवल ऑपरेटर और बायाँ कोष्ठक '(' रखे जाते हैं; ऑपरेंड कभी स्टैक में नहीं जाते बल्कि सीधे आउटपुट में लिखे जाते हैं। प्रत्येक प्रतीक अधिकतम एक बार पुश व पॉप होता है, इसलिए कुल टाइम व स्पेस कॉम्प्लेक्सिटी O(n) रहती है।
2. Step-by-Step Conversion Algorithm & Parentheses Handling (चरणबद्ध रूपांतरण एल्गोरिथ्म और कोष्ठक प्रबंधन)
[EN] Scan tokens left to right: (1) Operand -> append to output; (2) '(' -> push onto stack as a priority barrier; (3) ')' -> repeatedly pop stack operators to output until matching '(' is reached, then pop and discard '(' (neither '(' nor ')' ever appears in Postfix); (4) Operator op -> pop higher-precedence stack tops (or equal if left-associative) before pushing op; (5) At end of string -> pop all remaining operators to output.
[HI] बाएं से दाएं स्कैन करते हुए: (1) ऑपरेंड मिले तो आउटपुट में जोड़ें; (2) '(' मिले तो स्टैक में पुश करें; (3) ')' मिलने पर '(' आने तक स्टैक से ऑपरेटर पॉप करके आउटपुट में भेजें और दोनों कोष्ठक हटा दें; (4) ऑपरेटर आने पर स्टैक शीर्ष से उच्च (या समान बाएं-सहचारी) प्राथमिकता वाले ऑपरेटर पॉप करके नया ऑपरेटर पुश करें; (5) अंत में स्टैक के सभी शेष ऑपरेटर पॉप करें।
3. Equal-Precedence Tie-Breaker: Left vs Right Associativity (समान प्राथमिकता नियम: बाईं बनाम दाईं सहचारिता)
[EN] A common exam pitfall occurs when incoming operator 'op' has the EXACT SAME precedence as stack.top(). If 'op' is left-associative (+, -, *, /, %), you MUST pop stack.top() to output before pushing 'op'—ensuring A - B + C becomes A B - C + rather than A B C + -. Conversely, if 'op' is right-associative (^), do NOT pop on equal precedence—just push '^' so A ^ B ^ C becomes A B C ^ ^.
[HI] परीक्षाओं में अक्सर पूछा जाने वाला नियम यह है कि जब आने वाले ऑपरेटर और स्टैक शीर्ष की प्राथमिकता बराबर हो तो क्या करें। यदि ऑपरेटर बाएं-सहचारी (+, -, *, /, %) है, तो पहले स्टैक शीर्ष पॉप किया जाता है (जैसे A - B + C -> A B - C +)। लेकिन यदि ऑपरेटर दाएं-सहचारी '^' है, तो पॉप न करके सीधे पुश किया जाता है (A ^ B ^ C -> A B C ^ ^)।
4. Adapting the Same Stack Method for Infix-to-Prefix (इनफिक्स से प्रीफिक्स रूपांतरण में इसी विधि का उपयोग)
[EN] To convert Infix to Prefix using the Postfix algorithm: (1) Reverse the Infix token sequence while swapping every '(' to ')' and ')' to '('; (2) Run modified Postfix conversion where the tie-breaker is inverted (do NOT pop equal precedence for +, -, *, /, DO pop equal precedence for ^); and (3) Reverse the resulting string. Understanding why tie-breaking flips prevents subtle bugs on chains like A - B + C.
[HI] इसी स्टैक विधि से इनफिक्स को प्रीफिक्स में बदलने के लिए: (1) इनफिक्स स्ट्रिंग को पलटकर '(' और ')' को आपस में बदलें; (2) संशोधित पोस्टफिक्स विधि चलाएं (जहाँ +, -, *, / की समान प्राथमिकता पर पॉप न हो, पर ^ पर पॉप हो); और (3) प्राप्त परिणाम को फिर से उल्टा कर दें।
Syntax, Formula & Technical Example (Infix to Postfix Conversion using Stack Algorithm)
/* Trace: A + B * ( C ^ D - E ) */
Token | Stack | Output
A | | A
+ | + | A
B | + | A B
* | + * | A B
( | + * ( | A B
C,^,D | + * ( ^ | A B C D
- , E | + * ( - | A B C D ^ E
),End | | A B C D ^ E - * +
Infix to Postfix Conversion using Stack Algorithm Quick Reference & Comparison Table
| Scanned Infix Token | Stack & Output Action | Critical Conversion Rule |
|---|---|---|
| Operand (A, B, 5) | Appended straight to Postfix output string | Operands are never pushed onto operator stack |
| Opening Bracket '(' | Pushed onto Stack unconditionally | Acts as temporary barrier until matching ')' |
| Closing Bracket ')' | Pop operators to output until '(' is popped | Both '(' and ')' are discarded completely |
| Same-Rank Operator | Pop if Left-Assoc (+,-,*,/); Push if Right-Assoc (^) | Preserves A-B+C -> AB-C+ and A^B^C -> ABC^^ |
Infix to Postfix Conversion using Stack Algorithm Top 20 Bilingual MCQs with Answers
Q1. During Infix-to-Postfix conversion using a stack, which items are pushed onto the stack?
(स्टैक द्वारा इनफिक्स से पोस्टफिक्स रूपांतरण के समय स्टैक में किन्हें पुश किया जाता है?)
(A) Both operands and closing parentheses ')'
(B) Every character of the expression
(C) Only operands (variables and numbers)
(D) Only operators and opening parentheses '('
Correct Answer: (D)
[EN] Operands go straight to the output string, ')' triggers popping until '(', and only operators plus '(' sit on the stack.
[HI] रूपांतरण के समय ऑपरेंड सीधे आउटपुट में जाते हैं; स्टैक के अंदर केवल ऑपरेटर और '(' कोष्ठक रखे जाते हैं।
Q2. Trace Infix-to-Postfix conversion on 'A + B * (C ^ D - E)'. What is the exact Postfix result?
(इनफिक्स व्यंजक 'A + B * (C ^ D - E)' को पोस्टफिक्स में बदलने पर सटीक परिणाम क्या प्राप्त होगा?)
(A) A B + C D ^ E - *
(B) A B C D E ^ - * +
(C) A B C ^ D E - * +
(D) A B C D ^ E - * +
Correct Answer: (D)
[EN] Inside brackets C ^ D - E -> C D ^ E -; multiplied by B -> B C D ^ E - *; added to A -> A B C D ^ E - * +.
[HI] कोष्ठक में C ^ D - E से C D ^ E - बनता है, फिर * B और + A जुड़ने से उत्तर A B C D ^ E - * + आता है।
Q3. What happens when an incoming '+' sees '-' sitting at the top of the operator stack?
(यदि आने वाला ऑपरेटर '+' हो और स्टैक के शीर्ष (Top) पर '-' रखा हो, तो एल्गोरिथ्म क्या करेगा?)
(A) Push '+' directly on top of '-' without popping
(B) Pop '-' to output first (plus any lower/equal precedence below if needed), then push '+'
(C) Discard both '+' and '-'
(D) Stop conversion with a syntax error
Correct Answer: (B)
[EN] + and - share equal precedence and are left-associative, so the earlier operator '-' on top of stack MUST pop first.
[HI] + और - की प्राथमिकता समान है और दोनों बाएं-सहचारी हैं, इसलिए पहले से स्टैक पर मौजूद '-' को पॉप करके तब '+' पुश होगा।
Q4. What happens when an incoming '^' encounters another '^' already on top of the stack?
(यदि आने वाला ऑपरेटर '^' हो और स्टैक के शीर्ष पर पहले से '^' मौजूद हो, तो क्या किया जाता है?)
(A) Pop until '(' is reached
(B) Cancel out both '^' operators
(C) Pop the existing '^' to output and then push the new '^'
(D) Push the incoming '^' directly onto the stack without popping the existing '^'
Correct Answer: (D)
[EN] Exponentiation '^' is Right-to-Left associative, so the second '^' has higher effective binding and stays above the first '^'.
[HI] घातांक '^' दाएं-से-बाएं सहचारी होता है, इसलिए बराबर प्राथमिकता होने पर भी पुराना '^' पॉप नहीं होता बल्कि नया '^' ऊपर पुश हो जाता है।
Q5. What is the Postfix conversion of the expression '(A - B / C) * (A / K - L)'?
(इनफिक्स व्यंजक '(A - B / C) * (A / K - L)' का सही पोस्टफिक्स रूप कौन सा है?)
(A) A B C - / A K L - / *
(B) A B - C / A K - L / *
(C) A B C / - A K / L - *
(D) A B C / - A K L / - *
Correct Answer: (C)
[EN] First group (A - B / C) -> A B C / -; second group (A / K - L) -> A K / L -; combined with '*'.
[HI] पहला कोष्ठक A B C / - और दूसरा कोष्ठक A K / L - बनता है; अंत में '*' जुड़कर A B C / - A K / L - * देता है।
Q6. During conversion of 'A + B * C ^ D - E', what is the MAXIMUM number of items simultaneously stored on the operator stack?
(व्यंजक 'A + B * C ^ D - E' को पोस्टफिक्स में बदलते समय स्टैक में एक साथ अधिकतम कितने ऑपरेटर रहेंगे?)
(A) 3 (specifically '+', '*', and '^')
(B) 4
(C) 1
(D) 2
Correct Answer: (A)
[EN] As '+', '*', and '^' increase strictly in precedence, all 3 sit together on the stack before '-' pops them all.
[HI] '+' के ऊपर '*' और उसके ऊपर '^' (बढ़ती प्राथमिकता के कारण) एक साथ तीनों स्टैक में रहते हैं, फिर '-' आने पर पॉप होते हैं।
Q7. In contrast to 'A + B * C ^ D', what is the maximum stack size during conversion of 'A ^ B * C + D'?
(व्यंजक 'A ^ B * C + D' के रूपांतरण के दौरान स्टैक में एक साथ अधिकतम कितने ऑपरेटर मौजूद होंगे?)
(A) 1
(B) 3
(C) 2
(D) 4
Correct Answer: (A)
[EN] Precedence strictly decreases ('^' -> '*' -> '+'), so each incoming operator pops the previous one before pushing itself!
[HI] यहाँ प्राथमिकता लगातार घटती है ('^' से '*' फिर '+'), अतः हर नया ऑपरेटर पिछले को पॉप कर देता है और स्टैक का अधिकतम आकार 1 ही रहता है।
Q8. When ')' is scanned during Infix-to-Postfix conversion, what happens if the stack becomes empty BEFORE encountering '('?
(पोस्टफिक्स रूपांतरण में ')' मिलने पर यदि '(' मिले बिना ही स्टैक खाली हो जाए, तो इसका क्या अर्थ है?)
(A) Push ')' onto the stack instead
(B) The input infix expression has mismatched/unbalanced parentheses (extra ')')
(C) Simply ignore ')' and continue
(D) Conversion succeeded cleanly
Correct Answer: (B)
[EN] Every closing ')' must pair with an earlier opening '(' on the stack; running out of stack items exposes a syntax error.
[HI] हर ')' के संगत पहले से स्टैक में '(' होना जरूरी है; यदि '(' न मिले और स्टैक खाली हो जाए, तो व्यंजक में अतिरिक्त ')' की त्रुटि है।
Q9. What happens to '(' inside the stack when a lower-precedence operator like '+' arrives immediately after '(' (e.g., in 'A * (B + C)')?
(यदि स्टैक शीर्ष पर '(' हो और उसके बाद '+' आए (जैसे 'A * (B + C)'), तो क्या '(' पॉप हो जाता है?)
(A) It triggers an operator precedence conflict error
(B) No; '(' behaves as the lowest-precedence barrier in stack and is only popped by matching ')'
(C) Yes, '(' is popped to output immediately
(D) Yes, both '*' and '(' are popped
Correct Answer: (B)
[EN] Inside the stack, '(' prevents popping operators from outside the sub-expression until the matching ')' arrives.
[HI] स्टैक के अंदर '(' एक अवरोधक (Barrier) का काम करता है और सबसे कम प्राथमिकता रखता है; यह केवल ')' मिलने पर ही पॉप होता है।
Q10. Convert 'K + L - M * N + (O ^ P) * W / U / V * T + Q' into Postfix.
(इनफिक्स व्यंजक 'K + L - M * N + (O ^ P) * W / U / V * T + Q' का सही पोस्टफिक्स रूप क्या होगा?)
(A) K L + M N * - O P ^ W * U / V / T * + Q +
(B) K L M N * - + O P ^ W U V / / T * * + Q +
(C) K L + M N - * O P ^ W * U / V / T * + Q +
(D) K L + M N * O P ^ W * U / V / T * - + Q +
Correct Answer: (A)
[EN] K+L -> KL+; - M*N -> KL+MN*-; +(O^P)*W/U/V*T evaluates left-to-right across *, /, /, * yielding OP^W*U/V/T*+; finally +Q.
[HI] बाएं-से-दाएं नियम से K+L, फिर - M*N, फिर (O^P)*W/U/V*T और अंत में +Q हल करने पर K L + M N * - O P ^ W * U / V / T * + Q + बनता है।
Q11. What is the asymptotic worst-case time complexity of converting an n-token Infix expression to Postfix using a Stack?
(स्टैक का उपयोग करके n टोकन वाले इनफिक्स व्यंजक को पोस्टफिक्स में बदलने की वर्स्ट-केस टाइम कॉम्प्लेक्सिटी क्या है?)
(A) O(n log n)
(B) O(n)
(C) O(n^2)
(D) O(2^n)
Correct Answer: (B)
[EN] Each operator/parenthesis is pushed once and popped once, while each operand is appended once, giving strictly linear O(n) time.
[HI] प्रत्येक ऑपरेटर अधिकतम एक बार पुश व एक बार पॉप होता है, इसलिए कुल समय हमेशा रैखिक O(n) रहता है।
Q12. How many times can the while-pop loop execute across the ENTIRE run of Infix-to-Postfix on an expression of length n?
(n लंबाई वाले व्यंजक के पूरे रूपांतरण के दौरान आंतरिक while-pop लूप कुल मिलाकर अधिकतम कितनी बार चल सकता है?)
(A) Exactly n! times
(B) At most n times across the entire algorithm (amortized O(1) per token)
(C) Only 1 time total
(D) n^2 times in every nested expression
Correct Answer: (B)
[EN] Even though a single ')' or low-precedence operator may pop multiple items at once, total pops across the whole scan cannot exceed total pushes (<= n).
[HI] भले ही एक चरण में कई ऑपरेटर पॉप हों, पूरे एल्गोरिथ्म में कुल पॉप की संख्या कुल पुश (<= n) से अधिक नहीं हो सकती।
Q13. In Infix-to-Postfix conversion of '((A + B) * C)', how many characters from the 9-character input appear in the Postfix output?
(9 वर्णों वाले व्यंजक '((A + B) * C)' को पोस्टफिक्स में बदलने पर आउटपुट में कुल कितने वर्ण शेष रहेंगे?)
(A) 4 characters
(B) 5 characters (A B + C *)
(C) 7 characters
(D) 9 characters
Correct Answer: (B)
[EN] All 4 parentheses '(' and ')' are stripped during conversion, leaving 3 operands and 2 operators (5 tokens total).
[HI] सभी 4 कोष्ठक हटा दिए जाते हैं, जिससे केवल 3 ऑपरेंड और 2 ऑपरेटर—कुल 5 वर्ण (A B + C *) आउटपुट में बचते हैं।
Q14. If you accidentally forget the final 'while (!isEmpty()) output.append(pop());' step after scanning finishes, what goes wrong on 'A + B * C'?
(यदि स्कैन पूरा होने के बाद स्टैक के शेष ऑपरेटरों को पॉप करने वाला अंतिम लूप लिखना भूल जाएं, तो 'A + B * C' का क्या आउटपुट आएगा?)
(A) It causes Stack Underflow
(B) It prints '+ * A B C'
(C) It prints 'A B C * +' correctly anyway
(D) Only 'A B C' is printed because '*' and '+' stay stuck inside the stack
Correct Answer: (D)
[EN] Without final flushing, any operators still sitting on the stack at end-of-input are never emitted to output.
[HI] अंत में स्टैक खाली करने वाला लूप न चलाने पर '*' और '+' स्टैक में ही रह जाएंगे और केवल 'A B C' प्रिंट होगा।
Q15. When converting Infix to Prefix by reversing the Infix string first, what must you do to '(' and ')'?
(इनफिक्स स्ट्रिंग को उल्टा करके प्रीफिक्स बनाने की विधि में '(' और ')' कोष्ठकों का क्या करना होता है?)
(A) Leave '(' and ')' unchanged after reversing
(B) Swap every '(' into ')' and every ')' into '(' in the reversed string
(C) Convert both into square brackets
(D) Delete all parentheses before reversing
Correct Answer: (B)
[EN] Reversing '(A + B)' naively yields ')B + A(', which is invalid unless '(' and ')' are swapped to '(B + A)'.
[HI] '(A + B)' को सीधे पलटने से ')B + A(' बनता है जो गलत है; इसलिए पलटने के बाद '(' को ')' और ')' को '(' में बदलना अनिवार्य है।
Q16. Which rule is INCORRECT in the Stack-based Infix-to-Postfix conversion algorithm?
(स्टैक द्वारा इनफिक्स से पोस्टफिक्स रूपांतरण एल्गोरिथ्म के संदर्भ में कौन सा नियम गलत (INCORRECT) है?)
(A) Pop operators until '(' when encountering ')'
(B) Push operands onto the stack and immediately write operators directly to the output
(C) Push '(' onto the stack upon encountering it
(D) Pop left-associative equal-precedence operators from the stack before pushing the new operator
Correct Answer: (B)
[EN] Operands go directly to the output while operators go onto the stack—reversing this breaks conversion completely.
[HI] ऑपरेंड सीधे आउटपुट में जाते हैं और ऑपरेटर स्टैक में पुश होते हैं; इसका उल्टा लिखना बिल्कुल गलत है।
Q17. Within Infix to Postfix Conversion using Stack Algorithm, which scanned infix token directly maps to: "Appended straight to Postfix output string"?
(Infix to Postfix Conversion using Stack Algorithm में कौन सा Scanned Infix Token सीधे "Appended straight to Postfix output string" से संबंधित है?)
(A) Operand (A, B, 5)
(B) Closing Bracket ')'
(C) Same-Rank Operator
(D) Opening Bracket '('
Correct Answer: (A)
[EN] In Infix to Postfix Conversion using Stack Algorithm, 'Operand (A, B, 5)' handles 'Appended straight to Postfix output string' (Operands are never pushed onto operator stack).
[HI] Infix to Postfix Conversion using Stack Algorithm में 'Operand (A, B, 5)' का कार्य/विवरण 'Appended straight to Postfix output string' (Operands are never pushed onto operator stack) है।
Q18. Which option accurately describes 'Opening Bracket '('' in Infix to Postfix Conversion using Stack Algorithm?
(Infix to Postfix Conversion using Stack Algorithm के संदर्भ में 'Opening Bracket '('' की सही विशेषता कौन सी है?)
(A) Pop if Left-Assoc (+,-,*,/); Push if Right-Assoc (^)
(B) Pushed onto Stack unconditionally
(C) Pop operators to output until '(' is popped
(D) Appended straight to Postfix output string
Correct Answer: (B)
[EN] 'Opening Bracket '('' provides 'Pushed onto Stack unconditionally' — key point: Acts as temporary barrier until matching ')'.
[HI] 'Opening Bracket '('' का मुख्य विवरण 'Pushed onto Stack unconditionally' है (Acts as temporary barrier until matching ')')।
Q19. In Infix to Postfix Conversion using Stack Algorithm, identify the correct parameter for the specification: "Pop operators to output until '(' is popped".
(Infix to Postfix Conversion using Stack Algorithm में "Pop operators to output until '(' is popped" विवरण किस विकल्प के लिए सही है?)
(A) Closing Bracket ')'
(B) Opening Bracket '('
(C) Same-Rank Operator
(D) Operand (A, B, 5)
Correct Answer: (A)
[EN] 'Closing Bracket ')'' corresponds to 'Pop operators to output until '(' is popped' (Both '(' and ')' are discarded completely).
[HI] 'Closing Bracket ')'' का संबंध 'Pop operators to output until '(' is popped' (Both '(' and ')' are discarded completely) से है।
Q20. Considering Infix to Postfix Conversion using Stack Algorithm, what key behavior defines 'Same-Rank Operator'?
(Infix to Postfix Conversion using Stack Algorithm में 'Same-Rank Operator' की मुख्य भूमिका या मान क्या है?)
(A) Pushed onto Stack unconditionally
(B) Appended straight to Postfix output string
(C) Pop operators to output until '(' is popped
(D) Pop if Left-Assoc (+,-,*,/); Push if Right-Assoc (^)
Correct Answer: (D)
[EN] 'Same-Rank Operator' represents 'Pop if Left-Assoc (+,-,*,/); Push if Right-Assoc (^)' (Preserves A-B+C -> AB-C+ and A^B^C -> ABC^^).
[HI] 'Same-Rank Operator' का अर्थ/मान 'Pop if Left-Assoc (+,-,*,/); Push if Right-Assoc (^)' है (Preserves A-B+C -> AB-C+ and A^B^C -> ABC^^)।
Infix to Postfix Conversion using Stack Algorithm — Exam FAQs
Q1: Why does '(' have the highest priority when incoming, yet the lowest priority once inside the stack?
बाहर से आने पर '(' की प्राथमिकता सबसे अधिक, लेकिन स्टैक के अंदर जाने के बाद सबसे कम क्यों मानी जाती है?
[EN] Incoming '(' must be pushed unconditionally to open a sub-expression, whereas once inside the stack it must NOT be popped by operators like '+' or '*' inside that sub-expression until ')' closes it.
[HI] बाहर से आते समय '(' बिना किसी ऑपरेटर को पॉप किए सीधे पुश होना चाहिए, जबकि अंदर जाने के बाद कोष्ठक के भीतर के '+' या '*' द्वारा बाहर न निकले इसलिए इसकी इन-स्टैक प्राथमिकता न्यूनतम रखी जाती है।
Q2: How are unary operators like unary minus (-5) handled during Infix-to-Postfix?
इनफिक्स से पोस्टफिक्स रूपांतरण में यूनरी माइनस (जैसे -5) को कैसे संभाला जाता है?
[EN] A lexer distinguishes unary '-' from binary '-' (e.g., when preceded by start-of-input, '(', or another operator) and encodes it with a distinct higher-precedence unary token like '~'.
[HI] लेक्सर संदर्भ देखकर (शुरुआत, '(' या किसी ऑपरेटर के ठीक बाद आने पर) यूनरी '-' को अलग टोकन (जैसे '~') मानता है और उच्च वरीयता देता है।
Q3: What is the name of the classic algorithm for Infix-to-Postfix conversion?
इनफिक्स से पोस्टफिक्स रूपांतरण के इस प्रसिद्ध एल्गोरिथ्म को किस नाम से जाना जाता है?
[EN] Edsger Dijkstra's Shunting-Yard Algorithm (1961), named after railroad shunting yards that sort train cars onto sidings.
[HI] इसे एड्सगर डाइक्स्ट्रा का शंटिंग-यार्ड एल्गोरिथ्म (Shunting-Yard Algorithm, 1961) कहा जाता है।
Post a Comment
Post a Comment