Unit 6: Arrays Flashcards
2-D Arrays
Rectangular grids or matrices consisting of rows and columns. They allow for storing and accessing elements using two indices - one for row number and another for column number.
Accessing Elements in Arrays
Refers to retrieving or obtaining the value stored at a specific index position within an array.
Array Algorithms
Step-by-step procedures designed specifically for manipulating or processing arrays efficiently.
Array Creation and Access
Refers to the process of creating an array, which is a container object that holds a fixed number of elements of the same type, and accessing its individual elements by their index positions.
ArrayIndexOutOfBoundsException
An exception that occurs when trying to access an invalid index position in an array. It is thrown to indicate that the index used to access an array is either negative or greater than or equal to the size of the array.
Arrays
Are 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.
Average
Also known as the mean, is calculated by dividing the sum of a set of numbers by how many numbers are in that set.
Consecutive Pairs of Elements
Refers to two adjacent elements in a sequence or array.
Data Structures
Data structures are ways to organize, store, and manipulate data efficiently. They provide different methods of accessing, inserting, deleting, or searching for data elements based on specific requirements.
Default Values
This term refers to the initial values automatically assigned by Java if no explicit value is provided for variables during declaration.
Developing Algorithms Using Arrays
Refers to the process of creating step-by-step instructions to solve a problem or perform a task, specifically using arrays as a data structure. It involves breaking down complex problems into smaller, manageable steps and utilizing array operations to manipulate and access data efficiently.
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.
Exam Weighting
Refers to the allocation of points or marks given to each section or topic in an exam. It determines how much each part contributes to the overall score.
For Loop
A control flow statement that allows you to repeatedly execute a block of code for a specified number of times or until certain conditions are met.
FRQ
It is a type of question commonly found in AP Computer Science A exams where students are required to write code or provide detailed explanations without multiple-choice options.
Mode
Refers to the value that appears most frequently in a set of data.
NullPointerException
An exception that occurs when a program tries to access or use an object that has not been initialized, meaning it is currently set to “null”.
Object
An instance of a class that represents a specific entity or thing in a program. It contains both data (attributes) and behavior (methods).
Rotate
Refers to the action of shifting the order of elements either to the left or right. It is like rearranging a line of people by moving them in a circular motion.
sum
Refers to the result obtained by adding two or more numbers together.
Traverse an Array
To visit each element in the array, usually in order, to perform some operation on it.
Traversing Arrays
Refers to the process of accessing and examining each element in an array. It allows you to perform operations on every element or search for specific values within the array.
ArrayLists
Dynamic arrays that can grow and shrink dynamically as needed. They provide resizable arrays with additional methods for easy manipulation and management.
arrayName.length
This property is used to determine the number of elements in an array.
arrayName[index]
The syntax used in programming languages to access a specific element within an array. “arrayName” represents the name of the array, and “index” refers to the position of the desired element.
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.
Constructor
A special method within a class that is used to initialize objects of that class. It is called automatically when an object is created and helps set initial values for its attributes.
fixed size
Refers to a data structure or container whose size cannot be changed once it is created. Once initialized with a specific capacity or length, no additional elements can be added or removed from it.
For Loops
Control structures used for repetitive execution of code blocks. They consist of an initialization statement, condition statement, increment/decrement statement, and loop body. The loop continues until the condition becomes false.
Primitive data type
Basic data types provided by programming languages, such as integers, floating-point numbers, booleans, and characters. They represent simple values and have predefined characteristics.
Reference Data Type
A data type that refers to an object in memory rather than directly storing the value. It stores the memory address where the object is located.
Zero-indexed language
In computer programming, this refers to systems where counting starts from 0 instead of 1 when accessing elements in an ordered collection (e.g., arrays).
import java.util.Arrays;
A statement in Java that allows you to access the functionality of the Arrays class from the java.util package. It is used to import specific classes or entire packages into your program.
array.length
This property is an array refers to the number of elements it contains.
Limited Traversal
Refers to the process of accessing only a portion of a data structure, such as an array or list, instead of traversing through the entire structure. It allows for efficient retrieval and manipulation of specific elements within the data structure.
Reverse Traversal
Accessing elements in reverse order, starting from the last element and moving towards the first element in a collection or data structure.
Subsection
A smaller part or division of a larger section. In programming, it refers to breaking down a complex problem into smaller, more manageable parts.
Traversing
Refers to the process of accessing each element in a data structure, such as an array or linked list, and performing some operation on it.
while loop
A control flow statement that allows a block of code to be executed repeatedly as long as a specified condition is true.
Enhanced For Loop
Also known as a foreach loop, it is a simplified way to iterate over elements in an array or collection. It automatically handles indexing and provides an easy way to access each element without explicitly using indices.
Mutator Methods
Special types of methods in object-oriented programming that allow modification or mutation of an object’s attributes or properties.
Pass-by-value
The method of passing arguments to functions or methods by creating copies of their values instead of directly passing references to them.
Traverse
Refers to the process of accessing each element in a data structure (such as arrays or linked lists) one by one, usually for performing some operation on them.
Algorithm
Step-by-step procedures or instructions designed to solve specific problems or perform specific tasks.
Array
A fixed-size collection of elements of the same type stored in contiguous memory locations. It allows efficient access to individual elements using an index.
duplicates
Elements or values that appear more than once in a collection, such as an array or list.
evenFrequency
Refers to the occurrence of an element in a list or array that appears an equal number of times as other elements. In other words, every element with even frequency occurs the same number of times.
isEven
A boolean function that determines whether a given number is divisible by 2 without leaving a remainder.
Maximum
Refers to the largest value in a set of numbers or the highest point on a graph.
mean
Mean, also known as average, is calculated by adding up all values in a set and dividing it by the total number of values.
minValue
Refers to the smallest value in a set of numbers or data.
returnAllConsecutiveSequences
A function that takes an array as input and returns all consecutive sequences (subarrays) within it.
Reverse
To change the order of its characters, so that the last character becomes the first, the second-to-last becomes the second, and so on.
shiftLeft
Shift left refers to moving all elements in a list or array towards the left by one position. The first element becomes the last element after shifting left.
shiftRight
Shift right refers to moving all elements in a list or array towards the right by one position. The last element becomes the first element after shifting right.
sum
Sum refers to the result obtained by adding two or more numbers together.
Traversals
Traversals refer to the process of visiting and accessing each element in a data structure, such as a tree or graph, exactly once.