Static and dynamic data structure

From Computer Science Wiki
Programming basics[1]

The material below is used with great appreciation and gratitude from[2]

Static Data Structures[edit]

As same as the word static suggests, static data structures are designed to store static “set of data”. However, static “set of data”, doesn’t mean that we can not change the assigned values of elements. It is the memory size allocated to “data”, which is static. So that, it is possible to change content of a static structure but without increasing the memory space allocated to it.

Dynamic Data Structures[edit]

Dynamic data structures are designed to facilitate change of data structures in the runtime. It is possible to change the assigned values of elements, as it was with static structures. Also, in dynamic structures the initially allocated memory size is not a problem. It is possible to add new elements, remove existing elements or do any kind of operation on data set without considering about the memory space allocated initially.

Static Data Structures vs. Dynamic Data Structures[edit]

Static data structure is given a fixed area of memory which it can operate within. It is not possible to expand this fixed size in the run time. So that, locations of each element is fixed and known by the program. Dynamic data structure also has an area where it can operate. However, this size of the area is flexible, not fixed as it was with static data structures. It is possible to expand or contract the area as required, by adding or removing elements from data structure.


  • Define the term dynamic data structure.
  • Compare the use of static and dynamic data structures.