![]() Once you become somewhat proficient or know the poem inside-out, the linked list rolls (brain) into a hash table or array which facilitates O(1) lookup where you will be able to pick the lines from anywhere. There should be few anomalies in the analogy which might not fit well, but this somewhat explains how linked list works. Similarly, if you give him nothing at all, he will have to start from the start to get the lines. It's even easier if you could give him two lines, Alone she cuts and binds the grain, And sings a melancholy strain because he gets the flow better. ![]() Ok start from Reaping and singing by herself ?. It's even harder if you ask him what's the fifth line.Īt the same time if you give him a pointer, he will go forward. He will have to go from line one to reach there. If you ask the guy what's the last line, it will be harder for him to tell. Our mind doesn't work well like an array that facilitates random access. Let's take an example of mugging up 8 lines of Wordsworth's Solitary Reaper: Behold her, single in the field, In the initial stages of learning something by heart, the natural process is to link one item to next. Human brain can be a good example of singly linked list. And finally, the last person in the line, on the line, is the tail of the list. The person directly behind them on the line is the next in the list. The first person, at the teller, on the line, is the head of the list. That line is a (and I admit, this is a bit of a stretch) analogy for the pointer a linked list uses. People need to be standing on that line to be able to get to the teller. Imagine a line, drawn on the floor, that leads to a teller. How that list "contains" that list of things doesn't really matter to the user. A user just wants a list that contains a, well, list of things. Someone rightly answered that the pointer doesn't really matter to a user of a linked list. I noticed in one of your comments you asked about why the pointer matters. It may seem slightly useless to you now, but a few years from now, ask yourself the same question, you'll find yourself surprised that you ever wondered where it would be used.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |