programming Flashcards
what is an algorithm?
a set of instructions that describes how to solve a problem
what does language independent mean?
describes an algorithm that can be translated into any programming language
what is psuedo-code?
a simple way of describing a set of instructions in a manner that resembles a programming
what is an input?
data which is inserted into a system for processing and/or storage
what is a process?
an action taken by the program without input from the user
what is an output?
data which is sent out of a system
what is assignment?
setting the value of a variable in a computer program
why are flowcharts used?
a diagram that shows an overview of an algorithm and help construct a step by step solution
what do the different symbols in a flowchart mean?
rectangle = process
parallelogram = input/output
diamond = decision
oval = start/stop
what is decomposition?
breaking down a problem into smaller, more manageable chunks so they can be solved on their own
what is abstraction?
the process of removing unnecessary detail from a problem so that the important details can be focused on = makes problem solving easier
what is a variable?
a memory location within a computer program where values are stored
what are trace tables?
tables that keep track of changing variables
used when testing a program to record changes in variable values as code executes
what is data?
units of information
integers, characters, Boolean
define effciency
how much time it takes to run a particular algorithm and how much space is needed
what is an array?
a set of data values of the same type, stored in a sequence in a computer program
aka list
what is a search?
an algorithm that searches through a data set to find an item
what is a sort?
an algorithm that puts items in a data set into order
how does a linear search work?
- identify a search item
- look at the first item in the list
- compare the item with the search item
- check if they are the same, if so item is found, if not move to next item
- repeat these steps until last item in the list has been reached
how does a binary search work?
- start by setting the counter to the middle position in the list
- if the value held there is a match, the search ends
- if the value at the midpoint is less than the value to be found, list is halved, and upper half of list is searched and vice versa
- search moves to the midpoint of the remaining items and the steps continue until item is found
linear vs binary search
- for binary the data must be ordered, for linear not
- if list is longer and in order binary is more efficient (takes less time)