×
☰ Menu

Types of Data Structures

Depending upon the arrangement of data, data structures can be classified as arrays, records, link lists, stacks, queues, trees, graphs, etc.

According to the Nature of Size

  • Static data structure.
  • Dynamic data structure. 

Static data structure: A data structure is said to be static if we can store data up to a fixed number e.g., array.
Dynamic data structure: As its name suggests, a dynamic data structure is a data that allows the programmer to add or remove data while the program is executing by changing its size. Examples include a link list, a tree, and a graph.

According to Its Occurrence

  • Linear data structure.
  • Non-linear data structure.

Linear Data Structure: In linear data structure data is stored in consecutive memory locations or data is stored in a sequential form i.e., every element in the structure has a unique predecessor and unique successor, e.g., array, link-list, queue, stack, etc.
Non-linear Data Structure: In non-linear data structure the data is stored in non-consecutive memory location or data is stored in the inconsequential form e.g., trees, graphs, etc. A non-linear structure is mainly used to represent data containing a hierarchical relationship between elements. In this, elements do not form a sequence; there is no unique predecessor or unique successor.

Primitive and Non-primitive Data Structures

Primitive data structures are the basic data structures and are directly operated upon by the machine instructions, which is at a primitive level. These have different representations on different computers. They are integers, floating point numbers, characters, string constants, pointers, etc.
Non-primitive data structures are the more complicated data structure emphasizing the structuring of a group of homogeneous or heterogeneous data items. These are derived from primitive data structures. Array, lists, files, linked lists, trees, and graphs fall in this category.

Homogeneous and Non-homogeneous Data Structures

Homogeneous data structures: the data elements are of the same type as an array. 
Nonhomogeneous data structures: the data elements may not be of the same type as the structure in 'C'.