Data Structure
a data structure is a data organization, management, and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.
Language has primitive and non-primitive data types.
Primitive
In JavaScript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods or properties. There are 7 primitive data types.
In C language supports four primitive types - char, int, float, void. Primitive types are also known as pre-defined or basic data types.
Non-Primitive
JavaScript non-primitive types are objects. An object holds a reference/address of a single key-value pair or many key-value pairs. Whenever we refer to an object, we refer to an address in memory which contains the key-value pair.
The non-primitive data structures in C are also known as the derived data structures as they are derived from primitive ones. A large number of values can be stored using the non-primitive data structures.
When we study data structures, we learn to make new data structures with the native data structures (data types) implemented by our language of choice. We would implement functions to add constraints and/or behaviour on non-primitive data structure to hold primitive data as intended.
Sometimes, we implement data structure that cooresponds to a popular abstract data type, like a queue, stack, a tree. These are abstract data types. And if you look at any beginner data structure guide. They say you can commonly identify these data structure with the following characteristics:
For instance you can see Wiki's Queue (abstract data type) quoted for queue: "A queue is an example of a linear data structure, or more abstractly a sequential collection."
Here is my conundrum, a languages primitive and non-primitive data types are all just data structures in and of itself when it was implemented.
if they are just data structures. Then are those characteristics above also applicable to describe these data types? Would this be correct, an int is a data type of C, it is a data structure related to hold the mathematical range of numbers. Behind an interface, the data structure allows users to manipulate the bits that represents numbers. Because bits are lined up in on contiguous memory, it is linear. it is static for C, but maybe more dynamic in Javascript. Identifying whether it is homogenous, may be difficult. But, I would assume it is homogenous, because in each bit, it represent a concept of a number. brute force adding a sequence of bit representing a char to a primitive number would mistaken the purpose of its primitive data structure - and I assume that is often not allowed in higher language.