Data Collection (AP)

0.0(0)
studied byStudied by 0 people
0.0(0)
linked notesView linked note
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/34

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

35 Terms

1
New cards

What structure stores multiple related data items together?

Data collection

2
New cards

What type of array has a fixed size?

Array

3
New cards

What type of array can change its size dynamically?

ArrayList

4
New cards

What is an array?What type of loop is best when you need an index?

For loop

5
New cards

What type of loop is simpler for reading elements?

For-each

6
New cards

What algorithm adds all numbers in an array?

Sum

7
New cards

: Is .length a method or a property in arrays?

Property

8
New cards

What is the syntax to access an element in an array?

arrayName[index]

9
New cards

What algorithm finds the smallest value?

Minimum

10
New cards

What algorithm finds the largest value?

Maximum

11
New cards

What algorithm finds the smallest or largest value in an array?

Minimum or maximum algorithm.

12
New cards

What algorithm counts elements that meet a condition?

Counting algorithm

13
New cards

What does reversing an array do?

Swaps elements

14
New cards

What method adds elements to an ArrayList?

.add()

15
New cards

What method accesses an element from an ArrayList?

.get(index)

16
New cards

What method removes an element from an ArrayList?

.remove(index)

17
New cards

What method returns the number of elements in an ArrayList?

.size()

18
New cards

What replaces .length when working with ArrayLists?

.size()

19
New cards

What is the time complexity of linear search?

O(n)

20
New cards

What is the time complexity of binary search?

O(log n)

21
New cards

How do you traverse a 2D array?

Using nested loops

22
New cards

The automatic conversion between primitive types and their wrapper classes when used in collections.

Autoboxing

23
New cards

What error happens when using wrong index limits?

Off-by-one

24
New cards

What wrapper class matches the primitive boolean?

Boolean

25
New cards

What wrapper class matches the primitive double?

Double

26
New cards

What wrapper class matches the primitive int?

Integer

27
New cards

What are object versions of primitive types?

Wrapper classes

28
New cards

What is used to loop through 2D arrays?

Nested loops

29
New cards

What do you call an array of arrays?

Two-dimensional array

30
New cards

What sorting inserts elements in correct order?

Insertion sort

31
New cards

What sorting finds the smallest element each time?

Selection sort

32
New cards

What search works only on sorted arrays?

Binary

33
New cards

What search checks every element one by one?

Linear

34
New cards

What type of data can ArrayLists hold?

Object

35
New cards

What type of data can arrays hold?

Primitive or object