Sir, you are an excellent teacher and I thank you for your hard work.
@anabrr2 жыл бұрын
You are incredible, I don't know what would I do without you. Thank you so much!!
@ayushmanpraxri70635 жыл бұрын
Sir you're awesome thank you so much Makin these videos free you've cleared all of my doubts please keep making more data structures videos thanks again
@idomark1238 Жыл бұрын
bro gonna help me pass the next semester thank you sir
@abdulazizalramadan801 Жыл бұрын
Man thank you very much iam struggling in my data structure subject and u helped me alot with this linked list videos
@ThatiMoreira10 ай бұрын
Thanks a lot! Your videos are helping me so much!!!
@unexxzzz8186 Жыл бұрын
Sir, You are a true legend thanks alot
@memenator1853 жыл бұрын
I learned a lot from your videos, thank you so much :)
@arunkumarsawant65232 ай бұрын
While works. But for prints the fist value 15 and comes out.
@benogega2543 Жыл бұрын
An excellent explanation......
@adirk12593 жыл бұрын
Thanks you master teacher
@alasassi9602 жыл бұрын
what a great teacher
@huseynadze7933 Жыл бұрын
Hello, is stopping the iteration with ==NULL always safe? can't we mark the last one with "tail pointer" while adjusting to our linked list, and then while iterating we can check if the the current is equal to "tail"?
@CodeVault11 ай бұрын
It's not quite safe if you end up with cycles in the linked list (it can iterate forever)... The solution you wrote wouldn't be much safer since the cycle could end up not including the tail node thus iterating forever again
@huseynadze793311 ай бұрын
@@CodeVault makes sense, thank you :)
@SphereofTime5 ай бұрын
1:44
@TonimaHaque-x5g9 ай бұрын
Just fantastic🌷
@jenny127832 Жыл бұрын
Very helpful, thank you!
@alexneagoe52582 жыл бұрын
I think this was very good, thank you for this, it was an instant subscribe! I have a question. could the loop that you have used for printing, be modified in order to be used to with free? I could make the while loop work by swaping a temp value assigned with the next node with the current node value after free and using the current node !=NULL in the condition, but with for loop it wouldn't work, I would get funny valgrind errors (either would free the heap but with stack errors, or would memory leak the heap).
@CodeVault2 жыл бұрын
Cred ca asta ar trebui sa functioneze, am scos incrementul din for loop ca trebuie sa ai o variabila auxiliara dupa cum ai zis: for (Node* curr = &root; curr != NULL;) { Node* aux = curr->next; free(curr); curr = aux; } I guess, daca chiar vrei incrementul poti sa faci asta: Node* aux; for (Node* curr = &root; curr != NULL; curr = aux) { Node* aux = curr->next; free(curr); }
@alexneagoe52582 жыл бұрын
@@CodeVault salutare și mulțumesc de replyul foarte rapid, nu mi-am dat seama prima oară de unde ești. Am încercat ambele variante și au mers fără probleme (nu știam că pot face asta, sunt foarte bucuros că for loop poate fi manipulat cu un increment oarecum fake) // for loop without increment for(node *tmp = list; tmp != NULL;) { tmp = list->next; free(list); list = tmp; } // for loop with increment for(node *tmp = list; tmp != NULL; list = tmp) { tmp = list->next; free(list); } valgrind îmi arată că e totul ok!! Mulțumesc încă o dată, am învățat ceva nou și voi avea grijă să mă uit la celelalte materiale pe care le ai pentru C. Sunt la început deocamdată :)
@CodeVault2 жыл бұрын
Mult succes in continuare!
@PachucoDesigns4 жыл бұрын
Can you explain to me the difference between using arrow and using dot when referencing an attribute of a node? Because curr->x and curr.x seem to do the same thing.
@CodeVault4 жыл бұрын
curr.x; // Gets the x property from curr (where curr is a struct type) curr->x; // Gets the x property from curr (where curr is of pointer to struct type) Essentially, curr->x is a shorthand for (*curr).x, dereferencing curr then accessing the x property
@flames10878 ай бұрын
I Love your Teaching 💖
@arunkumarsawant65232 ай бұрын
Got 10 values of int from user in an array by scanf. Called malloc 10 times. Stored pointers in array of pointers. Assigned value and pointer next of struct nodes by dot operator. Values array and pointer array deleted. Every thing is on heap. Is this ok.?
@CodeVault2 ай бұрын
That's no longer a linked list, it's just an array with elements that are nodes. If the next pointer points to another place in that array than, yeah, that is still a linked list.
@fadieid5638 Жыл бұрын
Thank you for this amazing explanation. Just wondering, shouldn't we cast the malloc(sizeof(Node)) into a pointer to Node? malloc return void* type and we are assigning it to Node*
@CodeVault Жыл бұрын
I did some research on this and, in C++ it's recommended you cast the result of malloc, in C it is not
@fadieid5638 Жыл бұрын
Thank you, Intellisense on VS code was turning on this red squiggly line under the malloc signaling type mismatch
@moneyDev11113 жыл бұрын
thank you:) but do you know how to iterate elements in a vue recycler scroller list??????:)
@CodeVault3 жыл бұрын
I don't know much about vue
@Gowrilekshmi20214 жыл бұрын
Great course
@loukman41912 жыл бұрын
Thank you 💕
@mongraal22722 жыл бұрын
but root should be on heap,not on stack
@CodeVault2 жыл бұрын
In our case it's on the stack because of the definition (Node root). But you can define it on the heap if you want