3.2 Implementation of Stack using Array | Data Structure and Algorithm Tutorials

preview_player
Показать описание
Here I have discussed Array based Implementation of Stack data structure. Explained all the operations(push, pop, peek, traverse) with C program.

******************************************
See Complete Playlists:

*********************************************

Connect & Contact Me:

#jennyslectures, #datastructures #stack
Рекомендации по теме
Комментарии
Автор

mam, you are one of the best instructors of data structures...

arunodaykumar
Автор

pop("college stuff");
push(" jayanthi mam stuff");
thanks mam

saijaswanth
Автор

Implementation in C:
#include<stdio.h>

#define N 5
int stack[N];
int top=-1;

void push()
{
int x;
printf("Enter data:");
scanf("%d", &x);
if(top==N-1)
{
printf("Overflow");
}
else
{
top++;
stack[top]=x;
}
}

void pop()
{
int item;
if(top==-1)
{
printf("Underflow");
}
else
{
item=stack[top];
top--;
}
printf("%d\n", item);
}

void peek()
{
if(top==-1)
{
printf("Stack is empty");
}
else
{
printf("%d\n", stack[top]);
}
}

void display()
{
int i;
for(i=top;i>=0;i--)
{
printf("%d\t", stack[i]);
}
}

void main()
{
int ch;

do
{
printf("Enter choice for operation: ");
scanf("%d", &ch);
switch(ch)
{
case 1:
push();
break;
case 2:
pop();
break;
case 3:
peek();
break;
case 4:
display();
break;
default:
printf("Invalid choice");
}
}while(ch!=0);

}

nandinikumari
Автор

Ma'am, you are one of the best teachers I've ever known. You've made it so easy for me to understand all the stuffs that my school teacher made so difficult. Thank you so much ma'am.

aditishaw
Автор

Hi Jayanti ma'am now you are like a GOD for so many of the Students, because in our India @ Degree Colleges so many of the Professors themselves they will not be knowing even the BASIC CONCEPTS also, only few Professors like you will be Excellent..We need Professors like you @ clgs..Love you ma'am as your Student😘😘😍

bhadreesh
Автор

I m a lecturer at university. I learned teaching techniques from her ❤. She is amazing and really want to say thank you mam 🎉❤

dailydots
Автор

Thank you soo much, I've got an exam coming up and you saved me😍 and I'm sure so many more students like me. Your explanation method is soo crystal clear. Thank you.
Love and Respect,
From Sri Lanka.
Thank you ma'm

sallydeen
Автор

I am very lucky to find this video and having you as my teacher.

gaganlovejesus
Автор

mam, a standing salute for the effort you put into these videos, your teaching is simply amazing, even after 4 years people are relying on your videos, because no matter in which colleges we are, lecturers now a days don't take the burden of making things clear, and they expect us to understand everything without explaining what actually happens there....thank you from the bottom of my heart for the lectures mam ❤

Jyo-gogj
Автор

Mam you are really a blessing for me in this pandemic.... when I need a teacher as like you....you resolve all my problems....
Thankyou so

anjalityagi
Автор

One of the simplest explanation on internet ! Thank you !! You earned a life long subscriber. Respect Mam. ☺

bikrammajhi
Автор

Your lectures are really helpful during examination time mam... Thank you

miraklet_
Автор

thank you, we really appreciate this.

from Ethiopia.

clintontilahun
Автор

I was trying to learn stack since last four days.... Didn't understood anything
But after watching your videos....yeah I can say that i understood this... Thanks mam☺

aishwarya
Автор

Jayanti, I can't thank you enough. You are simply phenomenal.

idlconferencecentreknust
Автор

Unbelievable explanation and i become addicted of watching this channel.
thank you from Myanmar or Burma.

mdeliyas
Автор

Extraordinary ma'am. It was so clear. Full concept was made easy to understand..
Thank you so much

ramakrishnagkannari
Автор

Mam You are the Best .... I can't Express the Confidence you gave to me through this Lecture 🥺


May You live Long and Healthy Life Ameen 💗

zapeeosheikh
Автор

Thanks alot ma'am🙏😍 I had studied whole stack and tree with in one night and the very next Morning I score 55+ out of 77 in theory paper of 12 th premilary exam 😎

RahulSingh-eqxk
Автор

Very very helpful videos....
It's not that our teacher does not teach us well but he does not elaborate properly so it's hard to understand but after seeing your lectures my all doubts are cleared so thank you very much😊

yashwantbasnett