Please enable JavaScript.
Coggle requires JavaScript to display documents.
Ch.23 Algorithm Design(II) - Coggle Diagram
Ch.23 Algorithm Design(II)
Statements
Assignment Statement
place value(right) into a variable(left)
Output Statements
Output the processed input
Readable format
Input Statements
Variables
A character
A string
A number
Make programs flexible
Control Structure
Sequence Control Structure
executed in same order
Selection Control Structure
choose between alternatives
Decision Logic Structure
IF...THEN...ELSE
execute if TRUE
skip if FALSE
Case Logic Structure
Make only one decision from more than one option
Case {Expression} OF {Value}: {Statement}
Iteration
Repeat as the condition meets
Pretest Loop
FOR-loop
Repeat for a specific number of times
increment / decrement
WHILE-loop
run as long as the condition is satisfied
Posttest
DO...WHILE-loop
run at least once before check if satisfied
REPEAT..,UNTIL-loop
run until the condition is met
Arrays
Grouping homogenous data into a single data structure
"Load" data into an array
Searching
Loacte and Delete elements
Determining the position of insertion
Check if exist
Linear Search
Examining one by one from the first one
Slower than
Binary Search
Modular Apporoach
Spread codes into modules
Manageable
Self-contained
Save time
Easy to understand and debug
Allow Collaborating
Modules can be tested seperately
Easier to be Monitored and Controlled
4C17 Sam Ching