Unit 7: ArrayLists Flashcards
add(E obj)
The add(E obj) method is used to insert an element into a collection such as an ArrayList or LinkedList.
add(int index, E obj)
This method is used to insert an element at a specific index in an ArrayList. It shifts the existing elements to the right and increases the size of the ArrayList by one.
Algorithms
Algorithms are step-by-step procedures or instructions for solving problems or performing tasks. They provide clear instructions on how to solve problems efficiently.
ArrayList
A dynamic data structure that allows you to store and manipulate collections of objects. Unlike arrays, ArrayLists can grow or shrink dynamically as needed.
ArrayList Algorithms
Refer to the various methods and operations that can be performed on an ArrayList, which is a dynamic array-like data structure in Java. These algorithms allow for efficient manipulation, retrieval, and modification of elements stored in an ArrayList.
ArrayList constructor
A special method that creates an instance of the ArrayList class. It allows you to initialize an ArrayList object with specific elements or specify its initial capacity.
ArrayList Methods
Built-in functions that allow us to manipulate and work with ArrayLists, which are dynamic arrays that can grow or shrink in size.
Arrays
A collection of elements of the same data type, stored in contiguous memory locations. They have a fixed size and can be accessed using an index.
Authentication and Access Controls
Refer to the processes and mechanisms used to verify the identity of users and regulate their access to computer systems or resources.
ConcurrentModificationException
An exception occurs when a collection is modified while being iterated over using an iterator or enhanced for loop.
Data Structure
A way of organizing and storing data in a computer so that it can be accessed and used efficiently. It provides a systematic way to manage and manipulate data.
Delete element from ArrayList
Refers to the process of removing a specific item from the list, causing the remaining elements to shift down and fill the empty space.
Encryption
The process of converting plain text into a secret code to protect sensitive information from unauthorized access.
Enhanced For Loop (For-each Loop)
A simplified loop structure introduced in Java that allows easy iteration over arrays or collections without explicitly managing an index or iterator.
Firewalls
Security systems that monitor and control incoming and outgoing network traffic based on predetermined security rules, protecting networks from unauthorized access or malicious activities.
Import Statement
In Java is used to bring classes or packages from other libraries into your current program. It allows you to use those classes or packages without having to fully qualify their names.
Initial capacity
Refers to the starting size or capacity allocated for an ArrayList when it is created using its constructor. It determines how many elements can be stored in the list before it needs to dynamically resize itself.
Insert element in ArrayList
Refers to adding a new element at a specific position within the ArrayList. This operation shifts existing elements to accommodate the new element and maintains the order of the remaining elements.
Insertion Sort
A simple sorting algorithm where each iteration removes one element from an input data set and inserts it into its correct position within a partially sorted list until all elements are inserted.
Intrusion Detection Systems
Security tools designed to detect unauthorized access attempts or suspicious activities within computer networks or systems.
Java Collections Framework
A set of classes and interfaces in Java that provide implementations of common data structures like lists, sets, and maps. It offers a unified interface for working with collections of objects.
Linear Search
A simple searching algorithm that sequentially checks each element in a list until it finds the target value or reaches the end of the list.
Selection Sort
A simple sorting algorithm that repeatedly finds the minimum element from an unsorted portion of the list and swaps it with the first element of that portion until the entire list is sorted.
size()
A method that is used to determine the total number of elements present in a collection, such as a list or array.
Traversing ArrayLists
Refers to the process of accessing and examining each element in an ArrayList. It involves iterating through the elements sequentially, usually using a loop.
Wrapper Classes
Classes in Java that provide a way to wrap primitive data types into objects. They allow us to perform operations on primitives as if they were objects.