# Data Structure types and operations associated with them

Learn: In this article we are going to learn about **different data types**, **primitive and non-primitive data structures**. Operations associated with data structures. What are four basic data structure? And why these data structure required.

Submitted by Amit Shukla, on September 28, 2017

## Data Structure

**Data structure** is representation of the logical relationship existing between individual elements of data. In other words, a data structure is a way of organizing all data items that considers not only the element stored but also their relationship to each other We can also define it as mathematical or logical model of particular organization of data items.

**Data structure mainly specifies the following things:**

**Organization of Data****Accessing methods****Degree of associativity****Processing alternatives for information**

Data structures are the building blocks of a program. The selection of a particular structure focusses on the following two things:

- The data structure must be rich enough in structure to reflect the relationship existing between the data.
- The structure should be simple to process data effectively whenever required.

**Data Structure can be classified in to two broad categories:**

**Primitive data structure****Non primitive data structure**

### 1) Primitive Data Structure

Primitive data structure are basic structures and are directly operated upon by machine instructions. Primitive data structure has different representation on the different computers. Primitive data structure is divided in to four categories:

- Integer
- Floating point numbers
- Character constants
- Pointers

### 2) Non primitive data structure

Non primitive data structure are more sophisticated data structures. Non primitive data structure are derived from the primitive data structures. The non-primitive data structures emphasize on structuring of a group of homogeneous (same type) or heterogeneous (different type)data items.

Non primitive data structure are categorized into following:

- Array
- Linked list
- Queue
- Tree
- Graph
- Stack

**1. Array**

An array is the data type of non-primitive type. It is defined as set of number of same type of elements or we can say set of homogeneous elements or data items. It means an array can contain one type of data only, either all floating point numbers, or all characters. Declaration of array is a follow:

int A[10];

Where int specifies the data type of elements array stores. a is the name of array, and the number specified inside the square brackets (subscript) is the number of elements an array can store, this is also called **size** and **length** of the array.

**2. Linked list**

A linked list can be defined as a collection of variables number of data items. Lists are the most commonly used non primitive data structures. An element of linked list is consisting of two parts. One part is use to contain the value or parameter. While the other part is used to store the address of next element of the linked list.

**3. Queue**

Queue are first in first out type of data structure. In a queue new elements are added to the queue from one end called REAR. And element removed from the other end called FRONT.

**4. Tree**

A tree can be defined as finite set of data items called nodes. Tree is a nonlinear type of data structure in which data items are arranged in a sorted sequence. Trees represent the hierarchical relationship between various elements. The tree always grown in length towards bottom in data structure.

**5. Graph**

A graph G (V, E) is a set of vertices V and a set of edge E. An edge connects a pair of vertices. Vertices o the graph is shown as point or circle and edges are drawn as arcs or line segment.

**There are two types of graph:**

- Undirected graph
- Directed graph

Related Tutorials

- Structured Programming, its Advantages and Disadvantages
- Introduction of Data Structure
- Linear, Binary & Interpolation search
- Array Data Structure
- Introduction to Linked List
- Single Linked list and its basic operations with traversing implementation
- Single linked list insertion
- Single linked list deletion
- Deleting a node from a linked list without head pointer
- Implement union and intersection of two sorted linked lists
- Stack
- Implement of stack using array
- Implementation of Multi Stack in C
- Nesting of parentheses using stack

- Check for balanced parentheses by using Stacks (C++ program)
- Double Stack
- Implementation of Stack using two Queues
- Linear Queue
- Circular Queue
- Double Ended Queue (DeQueue)
- Priority Queue
- Implementation of Queue using two Stacks
- Hashing Data Structure
- Hash functions and its characteristics
- Collisions in Hashing and Collision Resolution Techniques
- Hashing | Separate chaining for collision resolution
- Hashing | Open addressing for collision handling
- Hashing coding problems

Comments and Discussions!