4.3 Queue Implementation using Linked List in C | Data Structure Tutorials

  Рет қаралды 490,695

Jenny's Lectures CS IT

Jenny's Lectures CS IT

Күн бұрын

Пікірлер: 260
@PrinceKumar-ux3qm
@PrinceKumar-ux3qm 5 жыл бұрын
The best thing is that you are making videos on algorithms and data structure, there are lots of channels in youtube they do teach programming languages but not data structure and algorithms.Thanks a lot mam🙏🙏🙏
@vishnupriyabalakrishnan920
@vishnupriyabalakrishnan920 2 жыл бұрын
Q1qq
@riyajaiswal2137
@riyajaiswal2137 2 жыл бұрын
I tried this code but its not working ...for linked list and array as well
@AnkitSingh-go6qq
@AnkitSingh-go6qq Жыл бұрын
@@riyajaiswal2137 yes i also check code is not working if we deque element many times
@VivekRaj-eb6mk
@VivekRaj-eb6mk Жыл бұрын
@@riyajaiswal2137 that's not code, that the algorithm .
@urstrulymadhu6390
@urstrulymadhu6390 Жыл бұрын
At struct datatype after} semicolon is required
@suvrajitdatta
@suvrajitdatta 5 жыл бұрын
Ma'am never stop making videos....teacher like u are needed are needed more and more in our society....ur explanations are supurb
@Varun00717
@Varun00717 5 жыл бұрын
waking up at 5 am every day. and seeing your face has now become a habit. thank you so much for such lovely explanations and clearing my concept. mam please make two videos on 1. Reverse a circular doubly linked list & 2. Implementation of circular queue using linked list. Thank you mam you are amazing
@mabenyjohnson6908
@mabenyjohnson6908 4 жыл бұрын
Your teaching makes it interesting to listen to you until the end... Because of the clarity and consistency of how you lay out your ideas.
@asmakhan541
@asmakhan541 4 жыл бұрын
Mam ur lectures is awesome. To the point,No time wastage!😘😘😘😘😘
@karthikc8992
@karthikc8992 5 жыл бұрын
jayanthi ma'am , u r simply superb... keep helping us best channel for learning DS
@NishantSingh-cs2dl
@NishantSingh-cs2dl 3 жыл бұрын
mam your way of teaching and the things you taught us I is beyond this comment section ......... You are such a great teacher and I have been in love with you and with your teaching........
@otetumooluwaseun3948
@otetumooluwaseun3948 5 ай бұрын
Thank you very much Jenny. You saved me during my C days and now still saving me learning C#. I see double beauties watching your videos.
@veereshnaik683
@veereshnaik683 5 жыл бұрын
best youtube tutor mam its uniques and direct point tq :)
@aalexa5504
@aalexa5504 3 жыл бұрын
Video not only is good but also teacher which teach,she is very amazing
@rashidulislamrasel207
@rashidulislamrasel207 3 жыл бұрын
Incridible class madam.I have been starting to learn data structure So I was searching good teacher.finally i have gotten your class.I have also subscribed your chanel.Love From Bangladesh.
@vaibhavshukla6911
@vaibhavshukla6911 8 ай бұрын
Thank you jenny ma'am for this amazing lecture.
@KarthikMakineedi
@KarthikMakineedi 11 ай бұрын
Mam I am improving my basic knowledge on coding I have so many of doubts on coding but your teaching coding is assume I am easier to learn thank you mam😊
@saiakshagn3553
@saiakshagn3553 2 жыл бұрын
Thank you so much maam.Your way of Teaching is so good that even a dull student can understand easily.Our Generation is so lucky, because We have you.
@rupinpatel9064
@rupinpatel9064 4 жыл бұрын
best lectures ever on Data structures and algorithms
@padalabalaji5432
@padalabalaji5432 Жыл бұрын
mam thanks a lot for teaching in such a simple way that can be understood by a new person to coding like me👏👏
@PankajPandeyfacts7931
@PankajPandeyfacts7931 Жыл бұрын
I struggles a.lot on this topic But I am clear right now Thank u mam from the bottom of my heart
@softmedun6794
@softmedun6794 Жыл бұрын
Wow amazing lecture Sabse acche meri pyari ma'am On of the best KZbin channel ❤
@cherukurisagarteja151
@cherukurisagarteja151 3 жыл бұрын
You are the most beautiful lecturer in this century
@adarshjadhav8877
@adarshjadhav8877 4 жыл бұрын
Pyaar ho Jaye ga mam, aise padhayenge toh...❤️❤️ . . . . . . . . DS se
@LEETanjubagri
@LEETanjubagri 3 жыл бұрын
very nice explanation mam and at last your smile is speechless.......... this motivates me to see the next lecture of u without tiredness. thank u for giving us your precious time.
@shivanshpathak9291
@shivanshpathak9291 2 жыл бұрын
1M .....Let's Go....Congo Ma'am, you deserve much more !!!!
@cs4u579
@cs4u579 3 жыл бұрын
I used to smoke weeds but at last when you said "bye,bye take care" I quit it,and made my 10 friends too. But joke safat it would be a more interactive if you have coded the logic live on IDE ,at last to the point , straight and simple explanation won my heart ♥️♥️
@keya.bitspilani5429
@keya.bitspilani5429 3 жыл бұрын
How the hell had I not watched such good lectures on data structures..amazing explaination ma'am 😊😊
@vaishnavijasutkar8480
@vaishnavijasutkar8480 4 жыл бұрын
Your teaching is best. Mam plz make videos of c programming also.
@mohdehtesham8357
@mohdehtesham8357 Жыл бұрын
Just one note while running the code as is, the front and rear are globally initialized as NULL, so the functions dequeue(), display() and Peek() will always hit on the first condition. So, there is a need to either initialise the front and rear as local and pass those as arguments to the given functions or update the global pointers to the recent values as a whole.
@shehaniperera8801
@shehaniperera8801 4 жыл бұрын
Great explanation ma'am.. Thanks to this video now I can do my home works peaceful...❤❤❤
@sushmanthavala7813
@sushmanthavala7813 2 жыл бұрын
One of the best teacher in the online platform we are very lucky to have a great teacher like you TQ mam
@ripalnakiya
@ripalnakiya 3 жыл бұрын
Best teacher on YT
@darpananand9848
@darpananand9848 2 жыл бұрын
Ma'am we can also check the condition for 1 element in Dequeue Function i.e if there is only 1 element in the Queue , and we want to delete it , then the code would be void dequeue() { struct node*temp=front; if(front==0 && rear==0) { printf("UnderFlow Condition "); } else if(front==rear) { printf("The element which is deleted is %d ",front->data); front=rear=0; free(temp); } else { printf("The element which is deleted is %d ",front->data); front=front->next; free(temp); } } BTW Thank you so much Ma'am for this Amazing Content ❤❤
@justcurious1940
@justcurious1940 9 ай бұрын
No need if we don't use the rear in the past functions I think .
@babon_zia
@babon_zia 6 ай бұрын
Thanks for letting me understand the queue concisely.
@ravibisht2904
@ravibisht2904 4 жыл бұрын
Mam apko dekh kr apne app hi padne mai man lag jata hai.. Nice explanation
@sivasubramani612
@sivasubramani612 4 жыл бұрын
@Jenny, I think at 2:50 sec, we can't consider front at the right end and rear at the left end since this is a singly linked list and after deque (which will take O(n)) we can't change the rear pointer to point the previous node. What do you think? If its right. please give a like so that it will be on top and will help others.
@pavanbhadane8334
@pavanbhadane8334 3 жыл бұрын
right brother
@mostafayounes9490
@mostafayounes9490 10 ай бұрын
Best Instructor Ever💯
@priyakaushik635
@priyakaushik635 4 жыл бұрын
Thankyou❤❤your lectures are really good
@princeverma-or7nc
@princeverma-or7nc 3 жыл бұрын
Great mind with great beauty ✨✨✨✨ Thanks you mam ❤
@AjeetKumar-mo6xt
@AjeetKumar-mo6xt 3 жыл бұрын
i can trust all your videos because your accuracy is around 100 percent
@riyajaiswal2137
@riyajaiswal2137 2 жыл бұрын
I tried this code but its not working...linked list and array as well for queue ...both arent working.
@Shubhampatil-du8ys
@Shubhampatil-du8ys 5 жыл бұрын
Awesome explanation maam, this video help me a lot
@surbhimishra2015
@surbhimishra2015 3 жыл бұрын
Ma'm you are awesome I have learned many topics from your lectures. During this online classes .Online classes are of no use .Thank you ma'am for this Amazing lectures🙏
@neerajanavya4178
@neerajanavya4178 2 жыл бұрын
Thank for your explanation madam your teaching is very nice and clear madam
@akasharyan6233
@akasharyan6233 2 жыл бұрын
Ma'am you should come to my clg coz no facaulty is like you And no 1 teach like as you teach🤗
@BhanuprakshSasapu
@BhanuprakshSasapu 3 ай бұрын
Mam becuz of you I got the confidence to write the exam
@barathkumarg3461
@barathkumarg3461 3 жыл бұрын
Thankyou for the wonderful explanation mam your lectures very helpful in this lockdown situation
@vakhariyajay2224
@vakhariyajay2224 2 жыл бұрын
Thank you very much. You are a genius. 👍👍🔝🔝👌👌🙏🙏
@ashishgrover4506
@ashishgrover4506 5 жыл бұрын
Thanks mam you make this topic very easy for me
@baraamayasa5190
@baraamayasa5190 Жыл бұрын
thanks for your great explanations the data structure more fun and a lot easier with your lessons in this code there is a little problem when the front and rear pointers referring to same node because front pointer will be null otherwise rear pointer will lost the node but in that situation must refer to null so we need to add that statement to the code. #include #include struct node{ int data; struct node* next; }; struct node* front=0; struct node* rear=0; void enqueue(int data){ struct node* newNode=(struct node*)malloc(sizeof(struct node)); newNode->data=data; newNode->next=0; if(front==0&&rear==0){ front=rear=newNode; } else{ rear->next=newNode; rear=newNode; } } void dequeue(){ struct node* temp=front; if(front==0&&rear==0){ //&&rear==0 printf("empty queue "); } else if(front==rear){ //peek(); front=rear=0; free(temp); } else{ //peek(); front=front->next; free(temp); } } void display(){ struct node* temp=front; if(front==0&&rear==0){ printf("empty queue "); } else{ while(temp!=0){ printf("%d\t",temp->data); temp=temp->next; } printf(" "); } } void peek(){ if(front==0&&rear==0){ printf("empty queue "); } else printf("front data: %d ",front->data); } int main() { dequeue(); enqueue(5); enqueue(0); peek(); enqueue(-3); display(); dequeue(); dequeue(); dequeue(); dequeue(); enqueue(11); peek(); display(); return 0; }
@maherinamdar2373
@maherinamdar2373 3 ай бұрын
Excellent teaching ma'am👌❤
@Mmkarts_i
@Mmkarts_i Жыл бұрын
Thank god we had an online like u mam, even ur lectures in online did it but not upto the point 😂
@bhojpuri-short34
@bhojpuri-short34 5 жыл бұрын
Thank you so much ! nice explanations
@bekind136
@bekind136 11 ай бұрын
mam thankyou so much literally so made data structures easy peasy
@Shivaniverma24317
@Shivaniverma24317 Жыл бұрын
Ma'am apko jitna thank you bolo utna Kam h 😊❤ but thank you so much ma'am 💝💯 you are the best ❤🎉
@raghavjoshi9751
@raghavjoshi9751 Жыл бұрын
Mam in deletion condition their should be one more condition that is else if(front==rear) { printf("deleted element is %d ",temp->data); front =rear=NULL; } cause in last else condition (front= front->next) that make the front to point to the next undefined memory
@starkgamex4925
@starkgamex4925 Жыл бұрын
Yes, I also noticed...that's why finding in comments
@satyamshukla3816
@satyamshukla3816 4 жыл бұрын
god bless you mam.you are best teacher ever
@fun.facts_videos
@fun.facts_videos 11 ай бұрын
thanks to you for saving my much time! superb!
@rahulsrivastava7017
@rahulsrivastava7017 4 жыл бұрын
in dequeue(), there should also be a condition for when there is only 1 element in queue, that is, else if(front==rear) { Node *temp=new Node(); temp=front; front=NULL; rear=NULL; free(temp); }
@pavanbhadane8334
@pavanbhadane8334 3 жыл бұрын
We can just write free(front) front=rear=NULL;
@mohammadismailhossain6435
@mohammadismailhossain6435 Жыл бұрын
😅
@justcurious1940
@justcurious1940 9 ай бұрын
@@pavanbhadane8334 exactly what ChatGPT just told me.
@saikumartamminana3530
@saikumartamminana3530 2 жыл бұрын
ur explaination is just awesome like you mam
@lks5343
@lks5343 5 жыл бұрын
Nice explanation mam , Thank you.
@researchayan4518
@researchayan4518 4 жыл бұрын
You have a MALAYALI English accent...good lecture.
@suhailaadeeb2780
@suhailaadeeb2780 3 жыл бұрын
mam super.i can understand ths ds through ur words
@3ngdzgu
@3ngdzgu 3 жыл бұрын
Thank you so much mam ur vedios are quit easy to understand the concepts of data structures....thank you lotzzz😊😊
@ghumoindia8828
@ghumoindia8828 2 жыл бұрын
to be honest I was distracted while going through the topic, its due to the beauty you hold mam.
@sharath5796
@sharath5796 3 жыл бұрын
note : while dequeue op, first we have to make temp->nxt as null and then free temp
@justcurious1940
@justcurious1940 9 ай бұрын
Do we make a memory address NULL before or after we free it ?
@coderssknowledge8342
@coderssknowledge8342 5 жыл бұрын
awesome explanation mam,thanks....,plzz make videos on sorting of linklist.
@nitinkhilari1389
@nitinkhilari1389 5 жыл бұрын
Excellent Teaching Ma'am
@truegrabbers
@truegrabbers 3 жыл бұрын
Mind Blowing Explanation Maam thank you :))
@sudharsands5773
@sudharsands5773 3 жыл бұрын
Mam, you missed discussing a case in dequeue() i.e,, when front==rear. When front and rear is point same node
@justcurious1940
@justcurious1940 9 ай бұрын
U will have to update the rear or the whole code will break;
@Crypto_UPDATE_2
@Crypto_UPDATE_2 5 жыл бұрын
Great Explanation.......
@prashantverma9920
@prashantverma9920 3 жыл бұрын
Crystal Clear.Thank You Very Much!!
@kashapogunagendra1130
@kashapogunagendra1130 Жыл бұрын
Thank for you teaching mam any how I understand what u said
@unique_bhanu
@unique_bhanu Жыл бұрын
Thank you so much 🙏 madam
@maishamolepo2216
@maishamolepo2216 4 жыл бұрын
Amazing content Jenny! Keep it up.
@alokshukla1223
@alokshukla1223 5 жыл бұрын
Thank you ma'am ! That was really very helpful.
@jithinmv6516
@jithinmv6516 5 жыл бұрын
in dequeue you forgot to write the case for a single element, I mean front and rear points to same node, Which means only one element in queue, So we have to do (front=NULL and rear=NULL)
@karamsingh7785
@karamsingh7785 4 жыл бұрын
That's exactly what i was going too comment
@arvsaurav
@arvsaurav 4 жыл бұрын
I think there is one other way i.e., if we will use only front==0 instead of (front==0 and rear==0) at every place.
@qasimalikhan9692
@qasimalikhan9692 3 жыл бұрын
else if(head==tail){ std::cout
@ankitxalxotoo5580
@ankitxalxotoo5580 2 жыл бұрын
@@qasimalikhan9692 thanks brother
@PrabhatKumar-jl3se
@PrabhatKumar-jl3se 5 жыл бұрын
thank you ma'am!!!!!
@HarithaSree14
@HarithaSree14 3 жыл бұрын
Awesome mam....Helps a lot
@ducatidiavel9639
@ducatidiavel9639 4 жыл бұрын
Hello Ma'am, I have 2 questions, 1) Given that the video is about a LL implementation of a linear Q, are there any rules that a circular linked list cannot be used, in place of a singly linked list with 2 pointers? 2) And regarding your statement that a DLL using a head and tail pointer.. A DLL uses Nodes that only have a previous and next pointer right?
@ayaamverma6742
@ayaamverma6742 2 жыл бұрын
1) A circular LL can be used here tho it will also contain the head and tail pointer like the singly LL used here; thus practically we will be using only the semi-circle of the CLL since our enqueuing and dequeuing are restricted between the head and tail pointer. Hence the last pointer of our CLL (from last node to first node) won't be of any use and simply be using memory space. Otherwise using a CLL is as good as singly LL.
@meghasinha1706
@meghasinha1706 3 жыл бұрын
Mam thanks for your efforts
@rohitborra2507
@rohitborra2507 4 жыл бұрын
beautiful and very clear
@saritakumari-oh8fs
@saritakumari-oh8fs 3 жыл бұрын
Absolutely genious mam
@ritabritabasak5652
@ritabritabasak5652 3 жыл бұрын
So so thanks Ma'am... 🌻🌻🌻♥️♥️
@StrollerEngineer
@StrollerEngineer 5 жыл бұрын
Please upload all videos on data structures we support you
@thecloudterminal
@thecloudterminal Жыл бұрын
Thank you for great explanation and putting so much effort mam 🙏
@zenithacademy4588
@zenithacademy4588 2 жыл бұрын
Very easily explained 👌
@polymathmeraj6750
@polymathmeraj6750 Жыл бұрын
a small correction..... in dequeue operation, a new condition will come, if(rear==front && front!=0 && rear!=0){ front =rear =rear->next; free(temp); }
@justcurious1940
@justcurious1940 9 ай бұрын
Yes, I agree .
@thevindudilmith5343
@thevindudilmith5343 Жыл бұрын
Thank you so much 😊♥️♥️♥️
@LakshanWannige
@LakshanWannige 8 ай бұрын
Thanks ma'am.
@tejamucharla2727
@tejamucharla2727 2 жыл бұрын
Hii mam this is teja.. In enqueue you did the one mistake. That is in while loop your wrote the temp. Never temp equals to 0.You to do temp->next ==0
@avirupbanerjee3253
@avirupbanerjee3253 4 жыл бұрын
Mam why do we need to specify both front and rear while checking whether the list is empty or not. We can do it using rear only.
@DoronOverflow
@DoronOverflow 2 жыл бұрын
I came across a video here, I think you have a bug, in the dequeue function. You did not check the case if in the queue have only one element. Because then what happens ? You do not maintain the rear pointer. For example when you check if the queue is empty the test will not be correct! Say try if your program to run: enqueue then do dequeue and then print. The easy correction is, after front = front->next: if (front == NULL) rear = NULL; Besides it looks great channel, will start watching
@allbestproducts682
@allbestproducts682 2 жыл бұрын
Thanks Jenny Maam
@nagalakshmilanka2942
@nagalakshmilanka2942 4 жыл бұрын
Mam please post a video on priority queue and it's algorithm
@cristianandresvargasgonzal4510
@cristianandresvargasgonzal4510 4 жыл бұрын
Very thanks is cool, this video.
@mirtanvirahmed3868
@mirtanvirahmed3868 4 жыл бұрын
I have implemented the logic myself first and then watching the video 😁
@RaviKumar-ts1kj
@RaviKumar-ts1kj 4 жыл бұрын
Mam u r videos are very useful , tnq lot mam keep doing more videos have a nice day and may god bless u.
@the_beauty_zone
@the_beauty_zone 2 жыл бұрын
Thank u sooo much ma'am
@alokshukla1223
@alokshukla1223 5 жыл бұрын
Ma'am ! A request...Can you make a video series on data base Management system, please..?
@junaidrashid6147
@junaidrashid6147 3 жыл бұрын
Mam God bless u
@gopavaramsaimadhuree520
@gopavaramsaimadhuree520 4 жыл бұрын
Very clear ma'am Thank you ma'am ❤️🙏
@shirishashetty3967
@shirishashetty3967 7 ай бұрын
Thanks a lot
@ferinpatel9679
@ferinpatel9679 Жыл бұрын
Thank you 🙏
3.3 Stack implementation using Linked List | Data Structures and Algorithm Tutorials
27:01
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
Will A Basketball Boat Hold My Weight?
00:30
MrBeast
Рет қаралды 121 МЛН
Sigma baby, you've conquered soap! 😲😮‍💨 LeoNata family #shorts
00:37
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 2,1 МЛН
Top 7 Data Structures for Interviews Explained SIMPLY
13:02
Codebagel
Рет қаралды 212 М.
Programming Languages Tier List 2024
16:18
Neal Wang
Рет қаралды 7 М.
4.2 Implementation of Queue using Arrays | Data Structures & Algorithm Tutorials
23:06
30 Programming Truths I know at 30 that I Wish I Knew at 20
17:41
Creating the Node of a Single Linked List
6:00
Neso Academy
Рет қаралды 1 МЛН
Application of Linked List (Addition of Two Polynomials)
17:29
Neso Academy
Рет қаралды 205 М.
Linked List Implementation of Stacks (Part 1)
9:24
Neso Academy
Рет қаралды 227 М.
3.2 Implementation of Stack using Array | Data Structure and Algorithm Tutorials
17:27
Jenny's Lectures CS IT
Рет қаралды 1,1 МЛН
Top 7 Algorithms for Coding Interviews Explained SIMPLY
21:22
Codebagel
Рет қаралды 425 М.
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18