A data structure is a collection of ‘values’ pertaining to a particular data type which are stored in such a manner that it allows effective modification and access.
A data type is a unique characteristic of data which informs the compiler on how to use the data.
- Primitive data types are the basic building blocks. For instance, float, char, Boolean, integer etc.
- Composite data types are composed of composite and primitive data types like array, string, struct etc.
- Abstract data types are distinguished based on their behaviour (queue, set, stack, graph etc.)
- There are primarily two types of data structures– primitive data structure and non-primitive data structure
Primitive Data Structure
- Primitive data structures consist of single values, and it fits the base architecture of the underlying computer (machine-level).
- There are four types of primitive data:
Non-Primitive Data Structure
- Non-primitive data structures are derived from the primary data types, and they are used to store a group of values.
- The non-primitive data structure is further subdivided into the linear data structure and non-linear structure.
Linear Data Structure
- In the linear data structure, the data items are arranged linearly, that is chronologically
- There are four types of linear data structure:
- Arrays– A finite group of homogenous data which is assigned contiguous memory locations
- Linked Lists- Here the elements (nodes) are assigned sporadically in the memory, and it consists of two parts: the data and the pointer
- Stack- An abstract data type, it is an ordered collection of items, where addition and removal of data takes place at the same end (‘top’)
- Queue- An abstract data type, it is an ordered collection of items, where addition and removal of data takes place at separate ends (‘rear’ and ‘front’ respectively)
Non-Linear Data Structure
- In the non-linear data structure, the data items are arranged randomly, i.e, the data values are inserted without maintaining any proper order.
- There are, namely, two types of non-linear data structure:
- Trees- It is an abstract data type, used for data storage and it is represented by nodes connected by the edges
- Graphs- It is an abstract data type, where objects are connected by links. Interconnected objects are represented by points (‘vertices’), and links connecting vertices are called edges.
Kady Smith is a professional writer with the reputed having oragnization more than five years of experience. She also offers academic assistance for writing papers like proofreading services via Myessayhelp.co.uk She also writes blogs, where she provides valuable information related to to their academic paper. Kady loves to take part in adventure sports when she is not working.