Primitive Data Structure vs Non Primitive Data Structure
Posted September 12, 2022 by Rohith and Anusha ‐ 1 min read
Primitive data structure is a fundamental type of data structure that stores the data of only one type whereas the non-primitive data structure is a type of data structure which is a user-defined that stores the data of different types in a single entity.
Primitive data structure | Non-primitive data structure |
---|---|
Primitive data structure is a kind of data structure that stores the data of only one type. | Non-primitive data structure is a type of data structure that can store the data of more than one type. |
Examples of primitive data structure are integer, character, float. | Examples of non-primitive data structure are Array, Linked list, stack. |
Primitive data structure will contain some value, i.e., it cannot be NULL. | Non-primitive data structure can consist of a NULL value. |
The size depends on the type of the data structure. | In case of non-primitive data structure, size is not fixed. |
It starts with a lowercase character. | It starts with an uppercase character. |
Primitive data structure can be used to call the methods. | Non-primitive data structure cannot be used to call the methods. |