AP Computer Science A - Standard Java Classes & Basic Functions + Variables

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 9

flashcard set

Earn XP

Description and Tags

10 Terms

1

Random Number Formula

(int)(Math.random() * numOfPossibleValues + startingNumber)

New cards
2

Random Number Function Range

0 - 0.999…

New cards
3

Empty 1D Array Construction

type[] arr = new type[size]

New cards
4

Full 1D Array Construction

type[] arr = {0,1,2,3…}

New cards
5

Function to get the amount of elements in 1D Array

arr.length; (Think that b/c it can’t expand, that therefore its a variable and not a function)

New cards
6

ArrayList Construction

ArrayList<Type> arrList = new ArrayList<Type>();

New cards
7

Read Element Data of ArrayList

arrList.get(index);

New cards
8

Function to get the amount of elements in arrayList

arrList.size();

New cards
9

Order Of Operations for Selection Sort (1st pass only - 3 Steps)

1) Grab First element

2) Iterate through rest and find smallest

3) Swap with first element

New cards
10

Order Of Operations for Insertion Sort (1st element - 6 Steps)

1) Grab first element

2) Compare to the next.

3) If next is lower, overwrite data of first data with next.

5) Repeat until next isn’t higher.

6) Replace current element with first element value.

New cards
robot