[C language programming] 1. Algorithm basis (thinking questions)

thinking questions

1. What are the characteristics of the algorithm?

Finiteness, certainty, feasibility, input, output

2. Give examples to illustrate what are computable and non-computable problems?

Computable problems refer to problems that can be solved by computer algorithms, that is, the solutions to problems can be obtained by writing programs. For example, finding the sum of two numbers, finding the maximum value in an array, etc. are all computable problems.
A non-computable problem is a problem that cannot be solved by a computer algorithm, that is, there is no program that can solve the problem. For example, the famous barber's paradox, the halting problem, and a program to determine whether a computer has a virus.

3. How to measure the computational complexity of a computable problem?

Look at the change and situation of the required time as the size of the problem grows.

4. What are the characteristics of iterative, recursive, and exhaustive methods?

An iterative method is a method of repeatedly executing a process, implemented through a loop control structure.
Recursion is a method in which a function calls itself and is solved by continually breaking down a problem into smaller subproblems.
Exhaustion is a method of solving a problem by enumerating all possible solutions.

Guess you like

Origin blog.csdn.net/weixin_44893902/article/details/132327441