In Chapter 3 we discussed the use of lists for storing data. The underlying data storage mechanism we use for lists is the array. In this chapter we’ll discuss a different type of list, the linked list. We’ll explain why linked lists are sometimes preferred to arrays, and we’ll develop an object-based, linked-list implementation. We’ll end the chapter with several examples of how linked lists can solve many programming problems you will encounter.
split() function without having to perform additional array element accesses.
When you determine that the operations performed on an array are too slow for practical use, you can consider using the linked list as an alternative data structure. The linked list can be used in almost every situation where a one-dimensional ...