all info from barrons book!
what is an abstraction in computer science
a way to represent essential features without including the background details/explanations; generalization
what are variables
they vary; you can assign values for the variable to represent, which can change based on how it is used in your algorithm/program
what is an algorithm
a set of tasks or instructions, like a recipe
how does MOD work (modulus)
it returns the REMAINDER between two integers
ex. 3 MOD 2 = 1, 4 MOD 2 = 0
note: if the dividend is LESS than the divisor, then the output will be the dividend value
ex. 3 MOD 4 = 3
what is a list
a type of data abstraction, reduces the complexity of a program by having multiple values in a single variable
index positions start at 1
note: in other programming languages, like python, the index position starts at 0
what are boolean operators
operators that determine the relationship between two variables, expressions, or values
ex. =, >, <, etc.
true AND true results in…
true
true AND false results in…
false
true OR true results in….
true
true OR false results in….
true
false OR false results in…
false
false AND false results in…
false
what is a linear search
an algorithm looks for an element in a list SEQUENTIALLY or beginning to end
what is a binary search
an algorithm looks for an element in a list by halving the number of elements that need to be searched after every comparison
note: list MUST be sorted, whether it is from ascending to descending or the opposite
note #2: for lists with text, binary search can be used if the lists’ elements are sorted in alphabetical order, or ascending to descending in alphabetical order
what are procedures
a set of code that is referred to by a NAME and can be called at any point in a program by using the procedure name