Primitive Data Structure
Primitive data structures can only have one value in a specific location.
Primitive data structures can also be called building blocks for data manipulation. Primitive data structures only contain values that are provided by the programmer. Examples: Integer, float, bullion, character.
Non-Primitive Data Structure
Non-primitive data structures are created with the help of primitive data structures.
They are classified into linear and non-linear data types.
Non-primitive data types are types that are defined by the programmer. Examples: Array, string, stack, queue..
Different between primitive and non primitive data structures
Primitive Data Structure | Non-Primitive Data Structure |
---|---|
Primitive data structure is the pre specified types of data that are supported by the programming language. | Non-primitive data structures are not defined in a language and created by the programmer. |
Primitive data structures will have a fixed value | Non-primitive data structure can contain absolute (Null) values. |
Can be used to call methods of operation | Non-primitive data type Can not be used. |
Primitive data structures can hold only single value in the specific location. | Non-primitive data structures that can be in a linear and non-linear sequence |
Primitive data structures are more compact than primitive data structures. | Non-primitive data structures complexity are more than primitive data structures but they are highly usefull. |
Primitive data structures are not created with the help of Non-primitive data structures. | Non-primitive data structures are created with the help of primitive data structures. |
Primitive data types are integer, string, boolean, float etc. | Non-primitive data types (reference types) are arrays, objects, stack, linked list, etc. |
0 Comments