1/34
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What structure stores multiple related data items together?
Data collection
What type of array has a fixed size?
Array
What type of array can change its size dynamically?
ArrayList
What is an array?What type of loop is best when you need an index?
For loop
What type of loop is simpler for reading elements?
For-each
What algorithm adds all numbers in an array?
Sum
: Is .length a method or a property in arrays?
Property
What is the syntax to access an element in an array?
arrayName[index]
What algorithm finds the smallest value?
Minimum
What algorithm finds the largest value?
Maximum
What algorithm finds the smallest or largest value in an array?
Minimum or maximum algorithm.
What algorithm counts elements that meet a condition?
Counting algorithm
What does reversing an array do?
Swaps elements
What method adds elements to an ArrayList?
.add()
What method accesses an element from an ArrayList?
.get(index)
What method removes an element from an ArrayList?
.remove(index)
What method returns the number of elements in an ArrayList?
.size()
What replaces .length when working with ArrayLists?
.size()
What is the time complexity of linear search?
O(n)
What is the time complexity of binary search?
O(log n)
How do you traverse a 2D array?
Using nested loops
The automatic conversion between primitive types and their wrapper classes when used in collections.
Autoboxing
What error happens when using wrong index limits?
Off-by-one
What wrapper class matches the primitive boolean?
Boolean
What wrapper class matches the primitive double?
Double
What wrapper class matches the primitive int?
Integer
What are object versions of primitive types?
Wrapper classes
What is used to loop through 2D arrays?
Nested loops
What do you call an array of arrays?
Two-dimensional array
What sorting inserts elements in correct order?
Insertion sort
What sorting finds the smallest element each time?
Selection sort
What search works only on sorted arrays?
Binary
What search checks every element one by one?
Linear
What type of data can ArrayLists hold?
Object
What type of data can arrays hold?
Primitive or object