Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. Which of the following are true ?
    1. A programming language which does not permit global variables of any kind and has no nesting of procedures/functions, but permits recursive can be implemented with static storage allocation
    2. Multi-level access link (or display) arrangement is needed to arrange activation records only, if the programming language being implemented has nesting of procedures/functions.
    3. Recursion in programming languages cannot be implemented with dynamic storage allocation
    4. Nesting of procedures/functions and recursion require a dynamic heap allocation scheme and cannot be implemented with a stack-based allocation scheme for activation records.
    5. Programming languages which permit a function to
    return a function as its result cannot be implemented with a stack based storage allocation scheme for activation records
    1. 2 and 5
    2. 1, 3 and 4
    3. 1, 2 and 5
    4. 2, 3 and 5
Correct Option: A

1. Statement is false since global variables are required for recursions with static storage. This is due to unavailability of stack in static storage.
2. This is true
3. In dynamic allocation heap structure is used, so it is false.
4. False since recursion can be implemented. 5. Statement is completely true. So only 2 & 5 are true. Hence (a) is correct option.



Your comments will be displayed only after manual approval.