Skip to content
← Back to glossary

リストList

Learn in the textbookFundamentals of Data Structures

DefinitionA list (リスト) is a data structure in which each element holds a pointer to the position of the next element, and these pointers chain the data into a single line.

ExplanationIn the example, following the pointers from the apple at the head gives the orange and then the grape. Because the pointers set the order, it need not match the order of the stored positions. Adding or removing an element in the middle only means rewriting the pointers on either side, with no other element having to move.

AnalogyThink of a treasure hunt. The first clue tells you where the next clue is hidden, and following them one by one leads you to the end.

Memory hookPicture a list of names in which each row carries an arrow saying "next one is over here".