Problem Solving Flashcards
Define problem
A problem can be regarded as a difference between a desired situation and reality
Define problem solving
the process of finding a solution for a problem
Define algorithm
a set of instructions written in a logical sequence that produces a solution to a problem.
The 2 phases of problem solving
problem solving phase (algorithm phase) and implementation phase
Steps in problem solving
identify/define the problem -> propose and evaluate solution -> determine the most efficient solution -> develop and represent algorithm -> test and validate solution
Divide and conquer approache
divide the problem into subproblems and conquer each subproblem before combining the solutions to a solution for the original problem
Ways to represent an algorithm
narrative, pseudocode, flowchart
Characteristics of an algorithm
concise, unambiguous, must terminate, unique, receives inputt, produces output, effective
Variables
can be changed eg: num1, age, product, total, length
Constant
does not change eg: pi, avogadro law, tax
Data types
specifies which type of value is stored in a variable eg: integer, float/real, string, character, boolean
Defining diagrams
a table with 3 columns: Input, processing, output
Input
The source of data provided. Can be identified by: given, read, accept
Processing
A list of actions to be performed to achieve required output (includes input and output)
Output
The end result which can be identified by: print, display, output