What is the value of 13*3?
39
What is Linear Search?
A search method that looks like each number individually and can be unsorted or sorted.
What is a list?
A list is an organized and formatted way of storing and retrieving data.
What index does APCSP lists start at?
1
What is the value of 6+3*5?
21
What is Binary Search?
A search method that halves the number of elements that need to be searched after every comparison and must be sorted.
What is the output?
animals=[cow,pig,dog,frog]
DISPLAY(animals[2])
pig
What will the following program display?
a=4*(3+6)
b=4*3+6
DISPLAY(A<=B)
FALSE
How do you type exponentiation in Javascript?
**
How many comparisons would it take to find the number 180 when using Linear Search?
11,35,2,1,56,76,3,33,90,180
10
What does append do to a list?
Adds the appended item to the end of the list
What can you deduce about A?
NOT(TRUE) or A=FALSE
A is FALSE
How would you describe modulus?
Modulus is the remainder that is left over after dividing the dividend by the divisor
What is the greatest number of comparisons needed to guarantee you can find any element in a list with length 128 with binary search?
8
How do lists reduce complexity?
Simplifying code, instead of having to have each element in the list go through the procedures and programs.
Let a robot be in the very bottom left corner of a 5 by 5 Grid. How many distinct ways are there for the robot to get to the middle square?
6C3 or 20
What is (((3*5)//6)**5)%10? (Javascript)
3
Would it be more beneficial to use binary search or linear search in a short list?
Linear Search
What is the output?
x=0
flavors=[strawberry,vanilla,chocolate,watermelon]
REPEAT UNTIL x>2
REMOVE flavors[x]
x=x+1
DISPLAY(flavors)
[chocolate,watermelon]
Let a robot be in the very bottom left corner of a 5 by 5 grid. Does the following get to the top left corner?
moveForward()
moveForward()
turnRight()
moveForward()
moveForward()
moveForward()
turnLeft()
moveForward()
turnRight()
moveForward()
moveForward()
No