Memory management technique of the data structure
There
are two types of memory management techniques of data structure. These are :-
v Static
Memory Allocation Technique :-
Static memory allocation
technique is used during compile time. In this all the variables occupy space
in the memory whether they are assigned a value or not.
EXAMPLE:
int a,b,c,d;
a=b/c;
printf
(“b”);
In this we declare four variables a,b,c,d, but only
three variables are used at compile time. But variable‘d’ also stored in to the
memory.
v Dynamic Memory Allocation
Technique :-
The dynamic memory
allocation technique is used at run time. In this the variables occupy memory
space only when they assigned value to the variable during runtime.
EXAMPLE
int
a,b,c,d;
a=b/c;
printf
(“b”);
Comments
Post a Comment