1. The algorithm must terminate infinite time. (True or false)
2. Any recursive algorithm has a recursive exit. (True or false)
3. The algorithm is a set of sentences, execute the sentences in order, process the examples, and get the correct answer. (Ture or false)
Answers
Answer:
(1) First, the algorithm must have an infinite number of steps because there are an infinite number of integers greater than one. Second, the algorithm will run forever trying to count to infinity. These problems violate our definition that an algorithm must halt in a finite amount of time.
(2) Recursion means "defining a problem in terms of itself". This can be a very powerful tool in writing algorithms.
(3) In mathematics and computer science, an algorithm (About this soundlisten)) is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of specifi problems or to perform a computation.
Answer:
false
Explanation:
An algorithm must consist of a finite number of instructions, but it does not necessarily terminate in a finite number of steps. Hope you got it