Applications of Stack Data Structure

Stack is used to perform following task:-
स्टैक का प्रयोग निम्न कार्यो को पूर्ण करने के लिए किया जाता है:-
 
1. Stack is used to store intermediate data (context) which is occurred in recursion process when recursion function ends all the elements of stack popped in one by one manner and evaluated then we provide result to the user. Hence stack must required in every recursive program.
स्टैक का प्रयोग रिकर्शन प्रक्रिया में पारायुक्त किये जाने वाले इंटरमीडिएट डाटा (कॉन्टेक्स्ट) को रखने के लिए किया जाता है। जब रिकर्शन कॉल समाप्त होती है, तब एक के बाद एक क्रम से सभी एलिमेंट को पॉप कर लिया जाता है एवं उनकी गणना की जाती है जिससे परिणामी हल प्राप्त होता है। अत: रिकर्सिव फंक्शन के लिए स्टैक डाटा स्ट्रक्चर अनिवार्य है।    

2. Stack is used in evaluation process of each arithmetic and logical expression. First of all infix expression of program is converted into postfix expression using stack. After that postfix expression is evaluate by CPU and stack must required to complete this process.
स्टैक का प्रयोग सभी गणितीय एवं तार्किक एक्सप्रेशन के मूल्यांकन में किया जाता है। सर्वप्रथम इन्फ़िक्स एक्सप्रेशन को पोस्टफिक्स एक्सप्रेशन में बदला जाता है इसके पश्चात् पोस्टफिक्स एक्सप्रेशन का मूल्यांकन किया जाट अहिया एवं हल प्राप्त किया जाता है।    

No comments:

Post a Comment

Stack Data Structure, Push, Pop and Peek Operations , Applications of Stack

Stack is a linear data structure. It is collection of ordered data elements. It is also known as LIFO system (last in first out). It means i...