keywords
truth tables
algorithms
runtime vs compiletime (double points if specific error is given)
miscellaneous (not compsci related)
100

this

method accesses itself
100

MUST BE ABLE TO EXPLAIN WHY:

A=true B=true

boolean c = (A||B)

System.out.println(c)

true

100

int x = 0

while (x<10){
x++;
}

how many times is the while condition evaluated to "true"?

10

100
int[] hi = new int[6];

System.out.println(hi[7])

runtime

must say ARRAYindexoutofbounds exception

100

whats my fav color

pink

200

public

can be accessed by other classes

200

boolean c = !(A||B)

System.out.println(c);

A=true B=false

true

200

given an array {5,3,6,2,1,6}, after 3 switches, which array will be more sorted if we use both an insertion sort and a selection sort?

selection sort: {1,2,3,6,5,6}
insertion: {1,5,6,2,3,6}

therefore selection sort is more sorted

200

System.out.println(4/0);

String c;

System.out.println(c)

compile time

nullpointerexception - c is not initialized

200

what pet would i like to have the most

cat

300

super

access superclass - must be called in first line

300

boolean c = (3.0 >= 4.0) || !(true || false)

false
300

for a data set containing a thousand, unsorted values, which would be the fastest to find a specific element?

A: merge sort into binary search

B: binary search

C: insertion sort

D: linear search

d: sorting takes more time than a linear search

300

System.out.println(4/0);


runtime error due to division by 0 = NaN

arithmeticexception

300

do i like gold or silver more

gold

400

void

no return value

400

boolean c = !(4=>5)

true, new cond is (4<5) by using demorgans law

400

given an array of n length, how many passes of a linear search would it take to identify that an element is not in the array?

n times

400

String awesomeSauce = fishyk1ns;

int q = awesomeSauce.indexOf("i");

System.out.println(awesomeSauce.substring(q,q+1);

runtime - indexoutofbounds

indexof will return -1 there is no i

400

whats my fav hobby outside of school

drawing

500

static

does not need an instance of a class to be called and can be modified by all methods of the class with effects that last

500

boolean c = ((3.0*4 == 7*x)&&(4.0*2!=16/2 && 4/2=x*(int) Math.random())
x=2

false - this will never evaluate to true because math.random will generate a double that will be truncated to 0. therefore, causing 4/2 to be incorrectly evaluated

500

a merge sort algorithm is used to organise a data set, provided below:
{4,5,2,3,5,6,8}
what will be the subarray provided on the far left side after the splitter() method is called twice?

{4,5}

500

public int mystery(){

int x = 100;

if (x>10){

x++;

mystery(x)

}

return 1
}

runtime error due to infinite recursion

stackoverflowerror

500

what show is #1 on my watchlist

suits