RAH pt2 Flashcards
Variables are using _________ to
redirect them to the memory
address
pointers
pointers are acting
as a __________ so that the
variable can be connected
function
__________ are associations when an element in a Set A is
directly associated to EXACTLY ONE element in Set B
Functions
T or F
Functions are applicable in a numeric manner
T
described as equations that will yield
a value depending on another numeric input.
Functions
is a well-defined, finite sequence of steps or
instructions designed to perform a specific task or solve a
problem.
algorithm
How does Efficient algorithms save time and resources
Faster code –> faster execution time –> lower energy and
financial costs –> lower consumption of fossil fuels –> lower
pollution
Measures the time an algorithm takes to run as a function
of the size of the input
Time complexity
measures the memory an algorithm requires during its execution
Space complexity
is used to describe the upper bound of an
algorithm’s running time or space requirements in terms of
input size.
Big O notation
helps benchmark and compare the performance of
algorithms
Big O notation
Domain
All possible inputs in a function
Range
all possible output from a function
input
the value you put in the function
output
the result you get out of a function
function with two arguments is
called a
binary
like a function except that it might not be
defined for some elements
Partial function
to mean a function that is defined on all its domain
total function
this function rounds down to the closest integer
Floor function
⌊x⌋
This function rounds up to the closest integer
Ceiling function
⌈x⌉
two integers, not both zero, is the
largest integer that divides them both.
Greatest common Divisior
Formula for mod?
5 mod 2
5/2 = 2.5
> take the floor of 2.5 which is 2 from 2.5
2*2 = 4
5-4 = 1
5 mod 2 == 1
We sometimes need to compute a list of values of a function. A useful tool
to accomplish this is the
map function
if a function’s range only one element but leaves one its called
Injective