DATA STRUCTURES
Data structure is the representation of the logical relationship existing between individual elements of data.
It is the mathematical or logical model of particular organization of data items.
CLASSIFICATION
I Primitive data Structure
These are basic structures and are directly operated upon by the machine instructions.
Eg. Integer, floating point, character, pointers etc.
II Non- Primitive data structure
These are derived from primitive data structures & emphasizes on structuring of a group of homogenous or heterogeneous data items.
Eg. Arrays, lists, files etc.
Memory Allocations in C
- 1. Compile time or Static allocation
The required amount of memory is allocated to the program element at the start of the program.
- 2. Run-time or dynamic allocation (using pointers)
The amount of memory to be allocated is unknown but the memory is reserved when only needed i.e, during the runtime.
C provides the following dynamic allocation and de-allocation functions :
I malloc( )
II calloc( )
III free( )
IV realloc( )