Iterating over a linked list in C

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Sir, you are an excellent teacher and I thank you for your hard work.

nto
Автор

You are incredible, I don't know what would I do without you. Thank you so much!!

anabrr
Автор

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

ayushmanpraxri
Автор

bro gonna help me pass the next semester thank you sir

idomark
Автор

Sir, You are a true legend thanks alot <3

unexxzzz
Автор

I learned a lot from your videos, thank you so much :)

memenator
Автор

Man thank you very much iam struggling in my data structure subject and u helped me alot with this linked list videos

abdulazizalramadan
Автор

Thanks a lot! Your videos are helping me so much!!!

ThatiMoreira
Автор

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"?

huseynadze
Автор

While works. But for prints the fist value 15 and comes out.

arunkumarsawant
Автор

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).

alexneagoe
Автор

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.?

arunkumarsawant
Автор

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.

PachucoDesigns
Автор

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*

fadieid
Автор

thank you:) but do you know how to iterate elements in a vue recycler scroller

moneyDev
Автор

but root should be on heap, not on stack

mongraal
join shbcf.ru