a) What do you mean by recursion?
b) What benefit is there in its use?
c) What drawbacks are there in its use?
problem 2: The factorial of a positive number can be find outd by using the formula:
n! = 1 x 2 x 3 x………x n
Though, the function factorial can as well be defined as a recursive function in programming exercises.
prepare down the major part of the program that comprises the given:
a) The function prototype
b) A positive integer variable n
c) An output statement to display n
d) An input statement to permit a user to enter a number (which is stored in variable n)
e) The other output statement which computes and displays the factorial of the number.
f) prepare down the function by using recursion.
a) Describe why a linked list is called a dynamic data structure?
b) What are the three most significant benefits of using linked list over arrays?
c) State one drawbacks of using linked list in structured programs.
problem 4: A stack is as well a dynamic data structure that can be implemented in its simplest manner by making use of arrays.
Declare a structure comprising:
a) An integer array to hold the elements of the stack
b) An integer to point out the position of the current stack top in the array.
Now prepare the “pop” operation to eliminate the top element from the stack.
prepare the “push” operation to add an element to the stack.