The basics about Linked List Class

(What has explained below is the brief concept of list which you can ignore if you are already familiar with the subject.)

In array, there are several contents in one memory block. On the other hand, Linked List has a memory block for each content that gets connected with other contents in surrounding by link (pointer).

Comparing to array, Linked List has the following advantage and disadvantage.

  • Advantage : Unlike array, you don't need to shift contents in the back when adding a new content or removing an old content. In other words, it is really fast to insert or remove.
  • Disadvantage : Unlike array, it is really slow in searching for a specific content in the middle since it starts searching from top to bottom one by one.
array_vs_list.png
Array vs Linked List