A Small Example of Building a Linked List in C
Translated from Chinese by Claude. Read the original
I’ve been studying C structs these past few days, so here’s a little piece of code I wrote in class. I’ve added comments, so it should be easy to follow. It builds a linked list by inserting at the head. My teacher said that in data structures, inserting at the tail is rarely used, because all the extra checks make the program complicated, so head insertion is what you’ll mostly see.
1 |
|
Today I dutifully went to the library and started my study journey. I don’t know how many days I can keep it up, but sticking with it is half the battle. I’ll log it on the blog to keep myself in check. What I want to say here is why I’m still memorizing TOEFL vocab: I’ve been putting this little dream off for three years now, so why not finish it in one go? There aren’t many years of youth left, and I don’t want regrets. That’s youth for you: even the most lost youth has its goal.