Dynamically Resizable Arrays (Lists)
摘要
This chapter explores the fundamental role of data structures in organizing and managing data, with a special focus on arrays. It begins by highlighting the essential nature of arrays as a widely used data structure, offering direct access to indexed elements, which yields computational benefits in certain applications. The discussion then covers the characteristics of classical arrays as seen in languages like C++ and Java, including their homogeneity and static nature, contrasting these with the dynamic arrays found in Python and other modern languages. The utility of arrays in various computer science domains, especially in sorting algorithms and as building blocks for more complex structures, is examined. The chapter also addresses the advantages of arrays, such as quick retrieval times and efficient memory use, alongside their limitations, including fixed sizes and the high costs of inserting or deleting mid-array elements. Concluding, the text debates the terminology used for these structures, advocating for “array” over “list” to honor the conceptual and historical continuity in the field of computer science. Through examples, readers will learn about managing data within dynamically resizable arrays, enhancing their understanding of data manipulation and storage techniques.