<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>push and pop operation in stack in data structure program - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/push-and-pop-operation-in-stack-in-data-structure-program/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/push-and-pop-operation-in-stack-in-data-structure-program/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Mon, 13 Sep 2021 07:17:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>push and pop operation in stack in data structure program - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/push-and-pop-operation-in-stack-in-data-structure-program/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is Stack in Data Structure ?</title>
		<link>https://www.wikitechy.com/interview-questions/data-structure/what-is-stack-in-data-structure/</link>
					<comments>https://www.wikitechy.com/interview-questions/data-structure/what-is-stack-in-data-structure/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 15:04:54 +0000</pubDate>
				<category><![CDATA[Data Structure]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[algorithm for push and pop operation in stack in c]]></category>
		<category><![CDATA[Altimetrik India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Apostek Software Interview Questions and Answers]]></category>
		<category><![CDATA[application of stack in data structure]]></category>
		<category><![CDATA[applications of stack in real life]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[array representation of stack]]></category>
		<category><![CDATA[Bharti Airtel interview questions and answers]]></category>
		<category><![CDATA[BMC Software interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Te interview questions and answers]]></category>
		<category><![CDATA[data stack]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Genpact interview questions and answers]]></category>
		<category><![CDATA[Globallogic India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[paramatrix interview questions and answers]]></category>
		<category><![CDATA[push and pop]]></category>
		<category><![CDATA[push and pop operation in stack in c program]]></category>
		<category><![CDATA[push and pop operation in stack in data structure]]></category>
		<category><![CDATA[push and pop operation in stack in data structure program]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Sapient Consulting Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[stack applications in data structure]]></category>
		<category><![CDATA[stack data structure in c]]></category>
		<category><![CDATA[stack data structure java]]></category>
		<category><![CDATA[stack definition]]></category>
		<category><![CDATA[stack implementation in java]]></category>
		<category><![CDATA[stack in c]]></category>
		<category><![CDATA[stack in data structure]]></category>
		<category><![CDATA[stack in data structure with example]]></category>
		<category><![CDATA[stack operations]]></category>
		<category><![CDATA[stack operations in capplication of stack]]></category>
		<category><![CDATA[stack pop]]></category>
		<category><![CDATA[stack program]]></category>
		<category><![CDATA[stack push]]></category>
		<category><![CDATA[stack push pop]]></category>
		<category><![CDATA[stacking containers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[Tracxn Technologies Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[what is meant by stack]]></category>
		<category><![CDATA[what is stack data structure]]></category>
		<category><![CDATA[what is stack in c]]></category>
		<category><![CDATA[what is stack in data structure]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[WM Global Technology Services India Pvt.Ltd Limited (WMGTS) interview questions and answers]]></category>
		<category><![CDATA[Xoriant Solutions Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Yodlee Infotech Pvt Ltd interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=487</guid>

					<description><![CDATA[Answer : A stack is a container of objects that are performed...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="what-is-stack-in-data-structure" class="color-pink" style="text-align: justify;">What is Stack in Data Structure ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>A stack is a container of objects that are performed based on last-in first-out (LIFO) principle.</li>
<li>A stack is a limited access data structure-elements can be added and removed from the stack only at the top. A stack is a recursive data structure.</li>
<li>The structural definition of a Stack is either empty or it consists of a top and the rest.</li>
<li>There are two basic operations performed in a Stack they are:</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li style="list-style-type: none;">
<ul>
<li>Push()</li>
<li>Pop()</li>
</ul>
</li>
</ul>
<div class="Content">
<div class="hddn">
<ul>
<li style="list-style-type: none;">
<ul>
<li>Push()-push function is used to add or insert new item into the stack.</li>
</ul>
</li>
</ul>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/data-structure/push-operation.gif" alt="POP Operation" /></div>
</div>
<ul>
<li style="list-style-type: none;">
<ul>
<li>Pop()-pop function is used to delete or remove an item from the stack.</li>
</ul>
</li>
</ul>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/data-structure/pop-operation.gif" alt=" Push Operation" /></div>
</div>
<ul>
<li>When a stack is completely full, it is said to be Overflow state and if stack is completely empty, it is said to be Underflow state.</li>
<li>Stack allows operations at one end only.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="other-operations-used-in-stack" class="color-blue">Other operations used in Stack</h2>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li>Peek()-The peek() function gets the top element of the stack, without deleting it.</li>
<li>isEmpty() -The isEmpty() function checks whether the stack is empty or not.</li>
<li>isFull()-The isFull() function is used to check whether the stack is full or not.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="features-of-stacks" class="color-green">Features of stacks</h2>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li>Dynamic data structures</li>
<li>Do not have a fixed size</li>
<li>Do not consume a fixed amount of memory</li>
<li>Size of stack changes with each push() and pop() operation. Each push() and pop() operation increases and decreases the size of the stack by 1, respectively.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="implementation-of-stack" class="color-purple">Implementation of Stack</h2>
</div>
</div>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/data-structure/stack-in-data-structure.png" alt=" Stack in Data Structure" /></div>
<div>
<h2 id="sample-code" class="color-blue">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-javascript code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-javascript code-embed-code">import java.io.*;<br/><br/><br/>/* Java program to implement basic stack <br/>operations */<br/>class Stack <br/>{ <br/>    static final int MAX = 1000; <br/>    int top; <br/>    int a[] = new int[MAX]; // Maximum size of Stack <br/>  <br/>    boolean isEmpty() <br/>    { <br/>        return (top &lt; 0); <br/>    } <br/>    Stack() <br/>    { <br/>        top = -1; <br/>    } <br/>  <br/>    boolean push(int b) <br/>    { <br/>        if (top &gt;= (MAX-1)) <br/>        { <br/>            System.out.println(&quot;Stack Overflow&quot;); <br/>            return false; <br/>        } <br/>        else<br/>        { <br/>            a[++top] = b; <br/>            System.out.println(b + &quot; pushed into the stack&quot;); <br/>            return true; <br/>        } <br/>    } <br/>  <br/>    int pop() <br/>    { <br/>        if (top &lt; 0) <br/>        { <br/>            System.out.println(&quot;Stack Underflow&quot;); <br/>            return 0; <br/>        } <br/>        else<br/>        { <br/>            int b = a[top--]; <br/>            return b; <br/>        } <br/>    } <br/>} <br/>  <br/>// Driver code <br/>class Main <br/>{ <br/>    public static void main(String args[]) <br/>    { <br/>        Stack s1 = new Stack(); <br/>        s1.push(80); <br/>        s1.push(75); <br/>        s1.push(90); <br/>        System.out.println(s1.pop() + &quot; Popped from the stack&quot;); <br/>    } <br/>}</code></pre> </div>
<h2 id="output" class="color-blue">Output</h2>
</div>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-javascript code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-javascript code-embed-code">80 pushed into the stack<br/>75 pushed into the stack<br/>90 pushed into the stack<br/>80 Popped from the stack</code></pre> </div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/data-structure/what-is-stack-in-data-structure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
