Stack Using Single Linked List - Part 1 | Data Structures Tutorial

preview_player
Показать описание
Stack Using Single Linked List - Part 1 | Data Structures Tutorial

💡 Also Watch

Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.

💡 Visit Our Websites

#DataStructures #Training #Course #Tutorials
--------------------------

💡 About NareshIT:

"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations

--------------------------

💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.

--------------------------

💡 Please write back to us at

Рекомендации по теме
Комментарии
Автор

HERE IS THE COMPLETE CODE OF STACK USING LINKED LIST:
#include<stdio.h>
struct node {
int data;
struct node* link;
};
struct node* top=NULL;

void push(int);
void pop();
void traverse();

void main()
{
int ch;
while(1)
{
printf("Choices are:\n");
printf("1.Push\n");
printf("2.Pop\n");
printf("3.Traverse\n");
printf("4.exit\n");
printf("Enter your choice: ");
scanf("%d", &ch);
printf("Your choice was: %d\n", ch);
switch(ch)
{
int ele;
case 1: printf("enter element to be pushed: ");
scanf("%d", &ele);
push(ele);
break;
case 2: pop();
break;
case 3: traverse();
break;
case 4: exit(0);
default: printf("Invalid input\n");
}
printf("\n");
}
printf("ok\n\n");
}

void push(int ele)
{
struct node*temp;
temp=(struct node*)malloc(sizeof(struct node));
temp->data=ele;
temp->link=top;
top=temp;
}

void traverse()
{
struct node* temp;
if(top==NULL)
printf("Stack is empty: \n");
else
{
temp=top;
printf("Stack elements are: ");
while(temp!=NULL)
{
printf("%d ", temp->data);
temp=temp->link;
}
}
}

void pop()
{
struct node* temp;
if(top==NULL)
printf("Stack is empty: Underflow\n");
else
{
temp=top;
printf("Deleted element is: %d", temp->data);
top=top->link;
temp->link=NULL;
free(temp);
}
}

goyaldeekshant
Автор

Sir can you please arrange the playlist video's in right order. At times it gets confusing to link everything together. Thank you! You have just helped me pass my sem 3 DS with this playlist :)

pritkalariya
Автор

I love your videos. I used to rote learn the codes but now once I see your videos, I find it so easy. I do the codes on my own. And I know if I get stuck in the exam, I can use the concept to re-create it on my own. Thank a lot sir!

architabhatnagar
Автор

Your teaching is very good to learn.... Thankyou sir

vinoth
Автор

Shrinivas sir you great thank you so much to being here I really enjoyed your videos🙏

yashrajrajmane
Автор

This operations are very banificial for study time for preparation examination😘❤️

punittech
Автор

Disappointed about videos are not in sequence

rahulnimankar
Автор

your explanation is super sir plz put a video on padding in structure and why it happens how to avoid the padding in c

akashyadagouda
Автор

Clarified teaching sir!!!so grateful to you!!!

harikamopada
Автор

hi Sir, this is really very helpful to understand, just want to correct one thing that memory allocation to linked list is never sequentially or contiguous time [2:40]

RahulKumar-wzii
Автор

Sir really great videos on data structure sir it will be good if u also provide algo along with programs for these programs in exam they ask us to write algorithm ( steps)

indiangamermohit
Автор

Super sir!!! . I am an embedded engineer. But really likes your teaching skills

sandeepkumarmanoharan
Автор

Sir you are really good quality information.

thinkahead
Автор

It will be better for us if the videos maintain a sequence, please keep an eye on that point

islamraisul
Автор

Heartful thanks to you sir for explaining clearly now your videos are helpful to the btech students in this pandemic situation🙏🙏🙏

rajini
Автор

good morning srinivas sir it isa very helpful t understand tutorial

ramshettishyamsunder
Автор

You make it so easy to understand sir !❤️ Now it's ezz peasy 😌

ankitgiri
Автор

thank you sir for such a nicely and easily explained video.
it will be more helpfull if you please make data structure lectures using java, its a request.

rohitkawade
Автор

Sir, Here As you are using dynamic memory allocation, the memory will be in heap, I think.It should not be in Stack.
So data is saved in Heap section of memory, not stack.But pointer pointing to stack is in Stack Memory.

dhavalpunjabi
Автор

Sir, I loved the explanation
But
temp->link=top is not working in my program.

nehakumar