Difference between primitive and non primitive data structures in tabular form
Answers
Answered by
70
1.primitive data type are predefined data type.ex-int ,float etc.
2.non primitve data type are based on class. it is also called refrence data type .ex- arrays, class etc
Answered by
2
Answer:
- Primitive data structure is a fundamental type 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 in a single entity.
- Examples of Primitive data structure are integer, float, character, pointer and they can hold a single type of value. Examples of non-primitive data structure are Array, Linked list, stack.
- Primitive data structure always contains some value, i.e., it cannot be NULL. Non-primitive data structure can consist of a NULL value.
- The size of Primitive data structure depends on the type of the data structure like size of int is 2 bytes, float is 4 bytes. In case of non-primitive data structure, size is not fixed.
- Primitive data structure can be used to call a method where as a Non-primitive data structure cannot be used to call a method.
Explanation:
- Data structure means organizing the data in the memory.
- There are two types of data structure
1. Primitive data structure.
2. Non-primitive data structure
Similar questions