Chapter 12 Flashcards

1
Q

What is a recursive definition? What’s an important piece of such definition?

A

A recursive definition uses a word or concept that is defined in the definition itself.

Every recursive definition must also have the base case. It’s the “alternative”, unique and non-recursive definition that serves as starting point for all the other points.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What’s the Peano’s definition of Natural numbers?

A
  1. 0 is a natural number
  2. For every natural number n, S(n) - the successor of n - is a natural number.

1 will be S(0), 2 = S(S(0)), every number n as S^n(0).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a recursive method?

A

It’s a method that invokes itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What’s the difference between direct and indirect recursion?

A

Direct recursion constinsts in a method calling directly.

Indirect recursion means that method calls itself by passing through other methods first.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly