idk Flashcards
Decomposition
process of
breaking a complex problem into
smaller component parts
Abstraction
process of removing
unnecessary detail and simplifying.
Generally, abstraction precedes
decomposition
subroutines
sequence of instructions that perform a
specific task.
Sequence
an action, or event, leads to the
next ordered action in a predetermined
order
Selection
In selection, a question is asked,
and depending on the answer, the program
takes one of two courses of action
Iteration
An iteration is a single pass
through a set of instructions
Counts
count the number of times a
process has occurred.
Rogue values
values that fall outside
the range or type of the ‘normal’ data that
will be processed by a program
local variables
only exist
for the lifetime of a subroutine and that the
data in those variables is only available to
the subroutine in which it is declared.
global variables
exist
throughout an entire program and that the
data in those variables is available to all
routines within the entire program.
selfdocumenting identifiers
named sensibly so that
a third party can understand their purpose
Merge sort
An unsorted list is divided into n sublists,
each containing 1 element.
The sublists are repeatedly merged to
produce new sorted sublists until there is
only 1 sorted sublist remaining
Bubble sort
The algorithm that repeatedly steps
through the list to be sorted.
The algorithm compares each pair of
adjacent items and swaps them if they are
in the wrong order.
The passes through the list are repeated
until no swaps are needed
linear searches
simple search process where a list
is searched until the required value is
found.
e binary search
The middle value in a list is inspected to
see if it matches the search value.
If the middle value is greater than the
search value, the upper half of the list is
discarded. If it is less than the search
value, the lower half is discarded.
This process is repeated, with the list
halving in size each time until the search
value is found