Fundamentals of Algorithms Flashcards
Algorithm
A sequence of steps designed to perform a particular task
Decomposition
Breaking down a problem into smaller sub-problems making the overall problem easier to solve
Abstraction
Including the necessary details and leaving out the unnecessary details when problem solving
add
+
subtract
-
divide
/
multiply
*
exponent
MOD
remainder
17 MOD 3 = 2
DIV
integer division
17 DIV 3 = 5
Variable
A variable is a location in memory in which you can temporarily store text or numbers
Sequence
the statements are executed in the order they are written in
Selection
the next step to be executed depends on whether the condition being tested is true or false
Iteration
the steps being repeated over and over again until the statement is true
Algorithm efficiency
A measure of how well an algorithm performs its task on a given data set
Integer
a whole number
Real
a number with a decimal point
Boolean
Can only be TRUE or FALSE
Character
A single alphabetic or numeric character
String
One or more characters enclosed in quote marks
Binary Search
The size of the list is approximately halved each time an item is examined until the item that is wanted is found
Linear Search
Items are examined in the sequence until the item that is wanted is found
Defines the range of values a variable may take.