edited by
4,584 views
17 votes
17 votes

A language $L$ allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use of memory. Which one of the following is true?

  1. A compiler using static memory allocation can be written for $L$
  2. A compiler cannot be written for $L$; an interpreter must be used
  3. A compiler using dynamic memory allocation can be written for $L$
  4. None of the above
edited by

2 Answers

Best answer
26 votes
26 votes

C.

Using dynamic memory allocation, memory will be allocated to array at runtime.

edited by
0 votes
0 votes
A compiler using dynamic memory allocation can be written for the language."

Dynamic memory allocation allows the allocation of memory at runtime, which is useful when the size of arrays is not known during compilation. This allows for more flexibility in managing memory and handling variable-sized arrays. Static memory allocation, on the other hand, is not suitable for cases where array sizes are not known at compile time.
Answer:

Related questions

19 votes
19 votes
4 answers
1
Kathleen asked Sep 29, 2014
7,084 views
Heap allocation is required for languages.that support recursionthat support dynamic data structurethat use dynamic scope rulesNone of the above
21 votes
21 votes
3 answers
3
Kathleen asked Sep 29, 2014
4,976 views
The correct matching for the following pairs is$$\begin{array}{ll|ll}\hline \text{A.} & \text{All pairs shortest path} & \text{1.} & \text{Greedy} \\\hline \text{B.} & \...
44 votes
44 votes
5 answers
4
Kathleen asked Sep 29, 2014
19,316 views
The concatenation of two lists is to be performed on $O(1)$ time. Which of the following implementations of a list should be used?Singly linked listDoubly linked listCirc...