this
MUST BE ABLE TO EXPLAIN WHY:
A=true B=true
boolean c = (A||B)
System.out.println(c)
true
int x = 0
while (x<10){
x++;
}
how many times is the while condition evaluated to "true"?
10
System.out.println(hi[7])
runtime
must say ARRAYindexoutofbounds exception
whats my fav color
pink
public
can be accessed by other classes
boolean c = !(A||B)
System.out.println(c);
A=true B=false
true
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
System.out.println(4/0);
String c;
System.out.println(c)
compile time
nullpointerexception - c is not initialized
what pet would i like to have the most
cat
super
access superclass - must be called in first line
boolean c = (3.0 >= 4.0) || !(true || false)
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
System.out.println(4/0);
runtime error due to division by 0 = NaN
arithmeticexception
do i like gold or silver more
gold
void
no return value
boolean c = !(4=>5)
true, new cond is (4<5) by using demorgans law
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
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
whats my fav hobby outside of school
drawing
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
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
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}
public int mystery(){
int x = 100;
if (x>10){
x++;
mystery(x)
}
return 1
}
runtime error due to infinite recursion
stackoverflowerror
what show is #1 on my watchlist
suits