Linked List - Implementation in C/C++

  Рет қаралды 1,628,801

mycodeschool

mycodeschool

Күн бұрын

See complete series on linked list here:
• Introduction to linked...
In this lesson, we will see implementation of basic insertion and traversal of a linked list.
Lesson on Dynamic memory allocation (malloc, new etc) -
• Pointers and dynamic m...
Series on pointers in C/C++:
• Pointers in C/C++
Drop your questions/queries in comments section.
mycodeschool on facebook : / mycodeschool

Пікірлер: 576
@brendanmilton5025
@brendanmilton5025 9 жыл бұрын
your videos are the only ones on youtube that seem to explain the concepts of linked lists and pointers in a clear and concise way. invaluable help. thank you so much.
@mycodeschool
@mycodeschool 9 жыл бұрын
Brendan Milton You are most welcome :)
@dyslexicunt
@dyslexicunt 9 жыл бұрын
***** The second line doesn't make any sense. Firstly, you're trying to cast the return value of malloc (a void pointer) to a Node. You can't do that, they're different types. In C++ you need to cast it to a pointer of type Node* (as the first line does). This cast is not required if you're in vanilla C. Even if the right hand side was correct, you then would be trying to assign a pointer to a Node * to a Node. You can't do that for the same reason as above, they're two conflicting types. The whole point (lol) of malloc is that it returns to you a pointer to some memory out on the heap and therefore you can only ever assign the return value of malloc, to a pointer.
@pradeepyadav1005
@pradeepyadav1005 9 жыл бұрын
+Gaming News Sir I think , First statement is points to a void pointer variable allocated by dynamic memory allocation. but Second statement is a simple variable which is allocated by dynamic memory allocation and converted in node variable by using explicit type conversion.
@bansalashu1613
@bansalashu1613 8 жыл бұрын
seriously dude you are a gift to us noob coders
@deepthiprakash715
@deepthiprakash715 8 жыл бұрын
I agree!! text books and reference books are just way too complicated for beginners to understand. he's amazing
@MrValentas
@MrValentas 10 жыл бұрын
I advise you to go on career teaching people coding and computer science. You would be winning top awards each year. Never in my life did I see better explanations than you videos. Your playlist only on Data Structures is worth at least 200 bucks as a course online :}
@mycodeschool
@mycodeschool 10 жыл бұрын
Thanks a lot MrValentas :)
@amritaanshnarain7524
@amritaanshnarain7524 3 жыл бұрын
He already is software engineer at Google
@Shubh4m15
@Shubh4m15 2 жыл бұрын
@@amritaanshnarain7524 really ?
@prakharkhandelwal7513
@prakharkhandelwal7513 2 жыл бұрын
@@Shubh4m15 Yes
@fcyare
@fcyare 2 жыл бұрын
are you still a live after 8 years
@robertmanigault625
@robertmanigault625 2 жыл бұрын
I recently discovered your videos. Many years ago I was a programmer with weak knowledge of data structures. Now, I've decided to gain a firm understanding of them. I've viewed several videos and am currently reading a book on the subject matter. You have managed to explain data structures so clearly that the seem so easy to understand. You are an outstanding teacher. Thanks for your videos.
@rhysrittgers2183
@rhysrittgers2183 4 ай бұрын
I have been trying to understand the actual coding concept of linked lists for about a week. I searched through countless videos, help forums, asked friends and this video right here was the most informative, easy to grasp explanation I have seen. Thank you more than you know
@_Some_Random_Dude
@_Some_Random_Dude 8 жыл бұрын
Sir, you just helped save my student backside, may whatever gods you worship give you money, children, whatever you want. Your lesson is the only one, that helped me understand the idea behind linked lists. I guess i'm too stupid for any other source. >.
@cristianorozco5675
@cristianorozco5675 5 жыл бұрын
These videos are really good! Thank you so much! You can't imagine how much I've struggled trying to learn linked lists.
@fazalimam143
@fazalimam143 6 жыл бұрын
i dont know why people are disliking your videos really you teach linked list in a very simple way and explain all the things in it really mindblowing
@20DoseOver
@20DoseOver 7 жыл бұрын
i will be graduated from youtube instutue of technology!
@kazirahiv2157
@kazirahiv2157 6 жыл бұрын
to create a structure type variable, you have to use "struct" keyword. If you have a structure named Node, and if you declare a Node structure type pointer variable and then store another Node type structure variable into that( link), you have to use pointer to "Node type pointer variable" to access the stored "Node type structure" contents in that particular pointer variable(in this case Node type pointer variable "link"). Hope you understand.
@MukeshRajput1982
@MukeshRajput1982 6 жыл бұрын
www.mukeshrajput102.com/2017/12/write-c-programs-to-implement-double_11.html
@pswalia2u
@pswalia2u 5 жыл бұрын
@Anonymous Darkhorse its nomenclature you can't change name for keywords
@alirezaghodsipoor2239
@alirezaghodsipoor2239 5 жыл бұрын
:)))))))
@rando899
@rando899 5 жыл бұрын
YIT yay
@RaGa_BABA
@RaGa_BABA 5 жыл бұрын
THIS IS GOLD..YOU DESERVE EVERY PENNY I GAVE TO MY COLLEGE
@federicovergallo805
@federicovergallo805 9 жыл бұрын
Indians IT teacher are the best in the world
@roushangiri4722
@roushangiri4722 7 жыл бұрын
how do you know he's an IITian?
@pabloescobar2089
@pabloescobar2089 7 жыл бұрын
Roushan Giri 'IT' :/
@goelsugam
@goelsugam 7 жыл бұрын
He is Indian dude...check his facebook page (OR) just search on google.
@goelsugam
@goelsugam 7 жыл бұрын
And IITian as well...Animesh Nayan (check on LinkedIn!!
@lightjoybliss
@lightjoybliss 7 жыл бұрын
IIITian ,extra i..
@jacksonkaib5122
@jacksonkaib5122 4 жыл бұрын
Thank you for creating this content. I am a computer science major that spent my first two years of college developing skills related to the humanities. To do so, I lost track of the stem framework. I lost the assumed or assimilated aspect of what makes a cs major a cs major. This video triggered the neurons I needed it to :)
@lindawisebear
@lindawisebear 7 жыл бұрын
Sir, you explain things incredibly well,largely because your diagrams are so clear and colour-coded.Thank you!
@ratelslangen
@ratelslangen 9 жыл бұрын
Wow, this is so much more easy to follow than my professors college.
@yangwang24
@yangwang24 9 жыл бұрын
+ratelslangen yeah~the same feeling.
@arontesfay2520
@arontesfay2520 5 жыл бұрын
I went trough a couple of videos on this topic and this is by far the best imo
@shantanusingh6728
@shantanusingh6728 3 жыл бұрын
One of the best explanation about Linked list on youtube...Thanks a lot @mycodeschool brother... P.S.: Who is watching this in 2020..?
@mycodeschool
@mycodeschool 11 жыл бұрын
Thanks a lot Shoib :)
@matthewbourgoin3629
@matthewbourgoin3629 9 жыл бұрын
You are THE man, I have a linked list lab tomorrow and you have officially saved me. Thank you so very much. 5/5
@kouonzoko2878
@kouonzoko2878 4 жыл бұрын
i have seen many coding videos on KZbin. but this channel has always provided me with the best explanations so far. thanks a lot for all your amazing videos.
@atiajulia4028
@atiajulia4028 5 жыл бұрын
Omg I read multiple explanations of linked lists online and in a text book but I still couldn't grasp the logic behind it. But you did it (also thanks to previous video about memory). You have a gift of explaining clearly and easily! Thank you!
@maroofkhatib3421
@maroofkhatib3421 6 жыл бұрын
Man..... i dont know how to thank you ... tomorrow i have practical exams and i could've learnt the code by heart and went but this explanation was just awesome can never forget this !! superb !!
@vishalsingh7967
@vishalsingh7967 3 жыл бұрын
Sir, What can i say about your teaching the way you make concept so understable is amazing .., We 'll always be your grateful for this
@pathapac
@pathapac 9 жыл бұрын
Best lessons ever. Have understood data structures in its entirety. You are an amazing teacher..!!! thank you so much for your free lessons
@aloysuskoh9238
@aloysuskoh9238 6 жыл бұрын
THANK YOU SO MUCH! Your video is the only video that is short, concise and easy to understand! It is so much simpler to understand link list now! Thank you soo soo much :D
@videoreborn
@videoreborn 9 жыл бұрын
Thank you so much! I would want more advanced application examples on linked list if possible! Love video lecture because I can pause and think and work on the understanding before moving on. Learning-on-demand!
@nguaial8490
@nguaial8490 8 жыл бұрын
You explain things so well especially coordinating between graphic presentation and the code. Thank you.
@mycodeschool
@mycodeschool 11 жыл бұрын
Thanks for noticing Anthony :)
@vikrant4666
@vikrant4666 6 жыл бұрын
u'll get 5 star room in heaven for sure
@ZeeshanJamal23143124324
@ZeeshanJamal23143124324 6 жыл бұрын
Even if he doesn't we are going to pray for him so he does.
@dishantnaik7431
@dishantnaik7431 4 жыл бұрын
time bomber?
@nikolayandcards
@nikolayandcards 4 жыл бұрын
Reading this just after reading he actually died.
@rahulsiddharth554
@rahulsiddharth554 4 жыл бұрын
@@nikolayandcards wait actually
@shobhitrealm
@shobhitrealm 3 жыл бұрын
@@rahulsiddharth554 yup in a car accident in 2014 or 2015 I guess. He was a IIIT Allahabad student.
@mayurizarekar4339
@mayurizarekar4339 8 жыл бұрын
thank you sooo much..it helped me a lot,my tutor had completely confused me.But your explanation seems so easy and simple.well done!
@GagandeepSingh-tl7zg
@GagandeepSingh-tl7zg 4 жыл бұрын
For those looking for java implementation. This can be converted easily to a generic implementation. public class LinkedList { private final Node head; public LinkedList() { head = new Node(); } // 1. Insert data. public void add(int data) { Node address = head; while(address.next != null) { address = address.next; } Node newNode = new Node(); address.next = newNode; newNode.data = data; } // 2. Traversal public void print() { Node address = head; if(address.next == null) { System.out.println("Empty"); return; } while(address.next != null) { System.out.println(address.next.data); address = address.next; } } /** * Private static inner class to create a node for the linked list. */ private static class Node { private int data; private Node next; } }
@Se-pk8lg
@Se-pk8lg 7 жыл бұрын
Thanks for explain the implementation in C/C++ Other videos just explain the idea but not explain how the implementation looks like in C/C++. Thank you very much!
@CodingKoleji
@CodingKoleji 2 жыл бұрын
I really felt in love with this channel the contents are very helpful before I hate this course in my college but for now I am really excited about thank a lot man for helping learners for free
@aishwaryaratnam154
@aishwaryaratnam154 6 жыл бұрын
Hey I first click the like button then I navigate to your content.man you are just beyond the boundary.life saviour for us.
@RezaGholamim
@RezaGholamim 6 жыл бұрын
You are an amazing teacher!!! Your videos are better than reading many books...Thanks
@ayusheetiwari4482
@ayusheetiwari4482 9 жыл бұрын
These videos are damn usefull...u are one of the best teacher here in youtube i have come acrossed....keep up the work...there are many students how need videos like these to enhance there skill!!! Thanks A LOT for your help REGARDS AYUSHEE TIWARI(M.P)
@sourabhuwusingh
@sourabhuwusingh 5 жыл бұрын
Sir you are the greatest coding teacher in the whole world !! You have helped me score 95 marks in c in my school! Thank you
@Darieee
@Darieee 7 жыл бұрын
Thanks man ! Would've preffered keyboard written code, but, I do like the human touch :D Keep up the good work !
@trevorg5938
@trevorg5938 9 жыл бұрын
Very helpful, I was having trouble with traversing linked lists, and then finding the maximum value, but this helped a lot!
@deadelaus2611
@deadelaus2611 3 жыл бұрын
This was amazingly helpful. You are clearly gifted at teaching these sorts of subjects. Thank you so much for these videos.
@kamrulislam9767
@kamrulislam9767 4 жыл бұрын
The best explanation I have seen ever. Thank you very much indeed.
@SaurabhSingh-kz5jv
@SaurabhSingh-kz5jv 8 жыл бұрын
Your videos really hold a patient and bold explainations... Thanks for doing so.
@LelnaG
@LelnaG 4 жыл бұрын
This video literally saved my life. Absolutely NOBODY else explains code better than this channel! Bless you!!!
@sanketkushwaha4238
@sanketkushwaha4238 5 жыл бұрын
Thankyou so much for your hard work .. Really learnt a lot from your videos ..I wish I could have teachers like you in my college ..
@dineshgupta9899
@dineshgupta9899 7 жыл бұрын
I remember studying this during my Engineering. Never understood the first time but 2-3rd time understood everything. Thanks for helping.
@BS_Mahlombe
@BS_Mahlombe 8 жыл бұрын
wow you are the best .I appreciate and salute sir
@ahmedifhaam7266
@ahmedifhaam7266 3 жыл бұрын
Why..just why..cannot (ANY) university professor explain it as simply as this guy..thank you so much.. explaining coudnt be made simpler ugh, amazing dude, amazing
@amanahmed6057
@amanahmed6057 3 жыл бұрын
because they don't want to
@hitikagahalot4549
@hitikagahalot4549 2 жыл бұрын
Finally cleared all my doubts. Thank you so much sir!!!!
@tusharjajodia9077
@tusharjajodia9077 3 жыл бұрын
Still the Best Video on the Platform For Sure
@biswa12341234
@biswa12341234 9 жыл бұрын
Really amazing Tutorial....clear precise and jargon free....and very clear concepts...Keep up
@semimathi6018
@semimathi6018 4 жыл бұрын
its actually very easy but only when its taught by a good teacher! Thank you so much, was very easy to unterstand!
@Capenuke
@Capenuke 8 жыл бұрын
Thank you. I wish my instructor would teach this way in a logical structure. Your videos are very valuable for a CS student. Well done.
@alexmathai1998
@alexmathai1998 7 жыл бұрын
You are a fantastic teacher! The best until now for me.
@dognip
@dognip 2 жыл бұрын
These videos are literally gold bars.
@stopthecap8810
@stopthecap8810 Жыл бұрын
this video is so useful, elaborate, thorough, and well explained that I use it just to brush up my memory of implementing a linked list in java lmao
@baibhavvikas1767
@baibhavvikas1767 2 жыл бұрын
thanks for talking about new node and malloc coz i didn't know about the new node feature of c++
@conquer_knowledge6608
@conquer_knowledge6608 3 жыл бұрын
this is 2021 ..but these videos are epic and unique...good videos sir
@055muditsingh7
@055muditsingh7 3 жыл бұрын
You have clear my doubts on array and linked list , thanks a lot for making a video.
@ukeez01
@ukeez01 3 жыл бұрын
you make hard topic too smooth..... Thanks Sir
@baileydanielle3885
@baileydanielle3885 6 жыл бұрын
GOD BLESS THIS VIDEO. My Computer Science grade thanks you endlessly.
@williamwu5798
@williamwu5798 Жыл бұрын
I am a computer science student and whenever I don't understand specific concepts in the data structure and algorithms, I will log in to my youtube account and then watch videos like this, finding that most of the professors in the university can only read PowerPoint which is lack of clarity and engagement. I do think that if professors can teach their students in this way, things will really get easier.
@akashs2514
@akashs2514 7 жыл бұрын
Amazing channel for programming. You should post more videos....
@chrome364
@chrome364 10 жыл бұрын
Your videos are so helpfull. I learned a lot thanks to you. Thanks a lot !
@ayushidutt8246
@ayushidutt8246 4 жыл бұрын
Hi, thank you for this wonderful playlist to help programmers in their struggle to grasp these basic concepts ! Also, another thing, would it not be better to keep an "end" pointer at the end of the linked list each time we added an element at the end. That way it would be faster to add element at the end of the list..
@himanshutrivedi4948
@himanshutrivedi4948 4 жыл бұрын
Hey I am not able to code this on my IDE can you please please reply me by sending the code to me in the reply section to this comment ?
@GalinaMalakhova
@GalinaMalakhova 4 жыл бұрын
Thank you, so clear and to the point, explains the important things!
@ishufaciasa7231
@ishufaciasa7231 6 жыл бұрын
You deserve an Oscar award for making ME understand what this nonsense is🙏
@rayhanulislam1675
@rayhanulislam1675 5 жыл бұрын
i am getting confused about the syntax between your use of C & C++ .
@globalmacro2817
@globalmacro2817 9 жыл бұрын
Thank you so much for the tutorial! clearly you explained better than my prof.
@annshu0641
@annshu0641 10 жыл бұрын
THE WAY U FOLLOW FOR TEACHING US is .......oh i cant say!!!!!!!THANKS ALOT..
@nazmussaqib2435
@nazmussaqib2435 8 жыл бұрын
Great work :) Thanks a lot :) you r just awesome man :) u saved my 16500taka because I don't need to retake this course :D :D
@moumitachakrabortyswarno3110
@moumitachakrabortyswarno3110 2 жыл бұрын
this series is a gem...respect u sir
@Gaggio23
@Gaggio23 9 жыл бұрын
Great job with these videos, you explain things really well. Keep up the good work!
@EPICHacks1996
@EPICHacks1996 9 жыл бұрын
There is a problem with ur loop, which is the final node won't be accessible if the condition: while(temp !=NULL) then it will be correct! anyway thank u so much :o
@PriyaSingh-ul4hl
@PriyaSingh-ul4hl 3 жыл бұрын
Yesss, even i needed clarification for that
@syedasadullah7025
@syedasadullah7025 6 жыл бұрын
nice job sir... love form Pakistan
@nazmussalehin7512
@nazmussalehin7512 7 жыл бұрын
It will be great if you publish a series only on different types of algorithm, implement them and show their application
@vijayank3207
@vijayank3207 9 жыл бұрын
thank you so much for uploading the videos .I clearly understanding what is happening back to the program.it is realy rice
@vatikaprasad
@vatikaprasad 7 жыл бұрын
you just got one more subscriber! Your words are golden. If possible, please makes tutorial videos on android development.
@EeicLi
@EeicLi 4 жыл бұрын
I am a bit confused at what is the node*? I know it means the pointer to node, so does node* mean “a pointer variable which stores the address of the next node”?
@shreyassule8526
@shreyassule8526 6 жыл бұрын
Thanks a lot. I have been following your videos for quite some time, and they have been the best help so far. All the concepts are explained in such a simple and easy to follow manner. With Linked List, is it possible for you to do it java for once. Any help or suggestions are much appreciated.
@ahmadibrahim3969
@ahmadibrahim3969 11 ай бұрын
This is a very clear explanation thanks a lot.
@gabrielferrin
@gabrielferrin 6 жыл бұрын
Your set of videos are the best. I'm studying these concepts now, but it's hard for me to understand the use of these in real life. Am I ever actually going to use these concepts to develop software in the real world??
@lordguthix1
@lordguthix1 9 жыл бұрын
Very usefull!! thank you so much for explaining in an easy manner.
@stephaniec6873
@stephaniec6873 6 жыл бұрын
Very well explained. I wish I knew it was in C/C++ before I began the video playlist, though.
@nilberthsouza8102
@nilberthsouza8102 6 жыл бұрын
I Learned a lot here. I came by codeDojo video about data structures
@sudhakarjha75
@sudhakarjha75 2 жыл бұрын
What a beautiful explanation ❤️❤️❤️❤️
@md.abuashraf6123
@md.abuashraf6123 9 жыл бұрын
best video ever for data structure using c++
@_bihim
@_bihim 8 жыл бұрын
Hats off to you!!! This video is really very much helpful to me.
@tejasjoshi9269
@tejasjoshi9269 7 жыл бұрын
hey, this video was very helpful for me to understand the syntactic flow of linked list and pointers. But I think there is a huge flaw in the step temp1->link = temp. Temp is pointing to the latest malloced memory, but when traversal, temp1 will stop a node before the final node, the node(can say node-1) whose link is NULL, that point where we want to stop. But this step will assign pointer of the last node not the second last one. If you think I am missing something and maybe wrong, please clarify. Thank you.
@tech-support5309
@tech-support5309 8 жыл бұрын
Awesome man..I really very thankful to you for this bunch of tutorials. Thank's man. :)
@akshaygupta2863
@akshaygupta2863 8 жыл бұрын
Thank you Sir, for providing excellent videos. Sir,can you please provide the videos of dynamic programming in data structures
@akshaykr7441
@akshaykr7441 4 жыл бұрын
wow!!!. i am just speechless,amazing content you have,you're superb dude!!!.
@sreekrishnapriyakuppa408
@sreekrishnapriyakuppa408 10 жыл бұрын
Hi, great vid.. I got i doubt here. Could we have used A directly instead of creating a temp varibale. Like the following instruction: A= (node*)malloc(sizeof(node)); before allocating values to the head node.
@nejmeddinne
@nejmeddinne 7 жыл бұрын
Thank you so much sir . this video really helped me to understand the linked list .
@Adasko000
@Adasko000 10 жыл бұрын
Wow, thats a piece of a great teaching work. Thanks a lot, mate! **subscribes the whole channel**
@vijaypalgodara1861
@vijaypalgodara1861 6 жыл бұрын
best ever lectures i had thankyou
@prasoonjha2958
@prasoonjha2958 4 жыл бұрын
Thanks a lot...This was really helpful.
@sauravsinha9193
@sauravsinha9193 7 жыл бұрын
eithe go with c or c++ don't confuse on each and every step plzzzz
@pabloescobar2089
@pabloescobar2089 7 жыл бұрын
saurav sinha exactly
@jatintayal4010
@jatintayal4010 7 жыл бұрын
yo pablo !! how is the afterlife?
@bhargavreddy7038
@bhargavreddy7038 7 жыл бұрын
omg that was so confusing , i literally got into depression becoz of that confusion . i don't know what to do with my life -_-
@patrasculucian2403
@patrasculucian2403 6 жыл бұрын
Did you managed to get out of that depression? Did you do something stupid? Are you still alive? Now seriously, for beginners: giving examples from 2 different *unknown* languages at the same time while grasping data structures, can be kinda confusing
@kushal1
@kushal1 6 жыл бұрын
I support this statement as a professional programmer. Second, for teaching to others it's not recommended to jumble. Just pick the best as they look completely upto you. Last, C++ for it's library functions support will always be preferred balanced language for competitive programming given that it has comparable speed to C.
@prasadkumbhar6670
@prasadkumbhar6670 8 жыл бұрын
HEY my code school your tutorials are excellent. I have one doubt in this tutorial where we create a new temp1 variable. When we want to link the nodes why can we write temp->link=100. What is the purpose of creating the node*temp1 and how does the linking process take place with temp1. I am getting a little confuse. Please help
@naveen1837
@naveen1837 3 жыл бұрын
temp already points to the address 100. so writing temp ->link = 100 wiil write 100 in the link of the last node which isn't correct
@KiranTammineni106
@KiranTammineni106 11 жыл бұрын
In this lesson you said the address of the head node is never modified, but we are actually modifying the head node to temp right. temp->data=2; temp>link=null; A = temp; Now the head node is pointed to the first block of memory
@satyamrai2577
@satyamrai2577 3 жыл бұрын
I love this channel.
@tarunkr.9041
@tarunkr.9041 6 жыл бұрын
best videos lectures in the universe
@arjunans5139
@arjunans5139 2 жыл бұрын
Thank god ,I found this channel
Linked List in C/C++ - Inserting a node at beginning
12:50
mycodeschool
Рет қаралды 1,1 МЛН
Introduction to linked list
17:13
mycodeschool
Рет қаралды 1,6 МЛН
Running With Bigger And Bigger Feastables
00:17
MrBeast
Рет қаралды 204 МЛН
Apple peeling hack
00:37
_vector_
Рет қаралды 72 МЛН
GTA 5 vs GTA San Andreas Doctors🥼🚑
00:57
Xzit Thamer
Рет қаралды 26 МЛН
Pointers and dynamic memory - stack vs heap
17:26
mycodeschool
Рет қаралды 1,4 МЛН
2.4 Linked List Implementation in C/C++ | Creation and Display | DSA Tutorials
29:01
Jenny's Lectures CS IT
Рет қаралды 1,7 МЛН
Binary search tree - Implementation in C/C++
18:36
mycodeschool
Рет қаралды 1,3 МЛН
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,2 МЛН
Understanding and implementing a Linked List in C and Java
18:15
Jacob Sorber
Рет қаралды 237 М.
how Google writes gorgeous C++
7:40
Low Level Learning
Рет қаралды 873 М.
Running With Bigger And Bigger Feastables
00:17
MrBeast
Рет қаралды 204 МЛН