Big Idea 3 (30-35%) Flashcards
variable
an abstraction inside a program
that can hold a value.
list
an ordered sequence of elements
EX: [value1, value2, value3, …]
element
an individual value in a list that is
assigned a unique index.
index
a common method for referencing
the elements in a list or string using natural
numbers.
string
is an ordered sequence of characters. EX:
“Hello World” is a string of characters.
algorithm
a finite set of instructions that
accomplish a specific task.
sequencing
the application of each step of
an algorithm in the order in which the code
statements are given.
code statement
a part of program code
that expresses an action to be carried out.
expression
consist of a value, a variable,
an operator, or a procedure call that returns a
value.
string concatenation
joins together two or
more strings end-to-end to make a new string
substring
part of an existing string.
boolean value
either true or false.
selection
determines which parts of an
algorithm are executed based on a condition
being true or false.
conditional statements
“if-statements,”
affect the sequential flow of control by
executing different statements based on the
value of a Boolean expression.
nested conditional statements
consist of
conditional statements within conditional
statements.
iteration
a repeating portion of an algorithm.
Iteration repeats a specified number of times
or until a given condition is met.
binary search algorithm
starts at the
middle of a sorted data set of numbers and
eliminates half of the data; this process repeat
until the desired value is found or all elements
have been eliminated.
procedure
a named group of programming
instructions that may have parameters and
return values
method / function
Procedures are referred to by different names,
such as method or function, depending on the
programming language.
parameters
input variables of a procedure.
arguments
specify the values of the
parameters when a procedure is called.
modularity
subdivision of a computer program into
separate subprograms
software library
contains procedures that
may be used in creating new programs.
simulation
a representation that uses
varying sets of values to reflect the changing
state of a phenomenon. (EX: plane simulation: like flying a real plane but online)
problem
a general description of a task
that can (or cannot) be solved algorithmically
instance
a problem also includes specific
input
decision problem
a problem with a yes/no
answer (e.g., is there a path from A to B?).
optimization problem
a problem with the goal
of finding the “best” solution among many (e.g.,
what is the shortest path from A to B?).
efficiency
an estimation of the amount of
computational resources used by an algorithm
heuristic
an approach to a problem that
produces a solution that is not guaranteed to
be optimal but may be used when techniques
that are guaranteed to always find an optimal
solution are impractical.`
decidable problem
a decision problem for
which an algorithm can be written to produce a
correct output for all inputs (e.g., “Is the number
even?”).
undecidable problem
one for which no
algorithm can be constructed that is always
capable of providing a correct yes-or-no
answer.