ARRL - ArrayList Overview

APCompSci_OverviewBanner.png

ArrayList

Introduction

Why is an ArrayList more appropriate for storing your Netflix watch list, while an array might be more appropriate for storing your class schedule?

We learned that data structures are helpful when storing multiple related data values. Arrays have a static size, which causes limitations related to the number of elements stored. It can be challenging to reorder elements stored in arrays. The ArrayList object has a dynamic size, and the class contains methods for insertion and deletion of elements. This makes reordering and shifting items easier.

Module Lessons Preview

In this module, we will study the following topics:

Introduction to ArrayList: In this module, you will learn how to create an ArrayList of objects. Since ArrayList is a class we will use the ArrayList constructor.

ArrayList Methods: Once an ArrayList is created we can use the methods in the ArrayList class to manipulate the elements. There are 6 methods that we will focus on in this course and which will be tested on the AP Exam.

Traversing ArrayLists: ArrayLists are used to hold large amounts of data. It will be necessary to traverse the data. Here we will learn how to use loops to traverse ArrayLists and the pitfalls that can arise if the ArrayList is modified within the loop.

Searching: The more data that is used the more difficult it can be to find specific elements. This lesson will demonstrate two ways to search through data in an array.

Sorting: Data is much easier to search if it is sorted. This lesson will show two of the sorts that will be tested on the AP Exam.

APCompSci_OverviewBottom.png  IMAGES CREATED BY GAVS