Week 1 Flashcards
1
Q
Criteria of algorithms?
A
- Input: zero or more quantities are externally supplied
- Output: at least one quantity produced
- Definiteness: each instruction is clear and unambiguous
- Finiteness: if we trace out the instructions of an algorithm, then for all cases the algorithm terminates after a finite number of steps
- Effectiveness: every instruction must be very so that it can be carry out by a person only by pencil and paper
2
Q
Components of Pseudocode?
A
- Variable
- Iterative
- Selection
- Module
3
Q
Disadvantages of Recursive?
A
- Memory allocation
- Finite condition (avoid infinite loop)
- Debugging technique
- Understanding of scope variable
4
Q
Term of module in programming language?
A
- procedure
- sub
- function
5
Q
communication with the caller dialing module?
A
- using parameter
- by value
- by reference/location
6
Q
Disadvantages of Recursive algorithm?
A
- memory allocation
- finite condition (avoid infinite loop)
- debugging technique
- understanding of scope variable
7
Q
What is module?
A
several lines of algorithm that work for certain function can be group in a module
8
Q
Components of Pseudocode?
A
- variable
- iterative
- selection
- module
9
Q
basic steps of algorithm?
A
- simplify problem
- build mathematically solving plan
- design an algorithm
- test correctness of program
- implement the algorithm to a programming language
- documentation
- analyze complexity of the program