Data Structures and Algorithms
Welcome to Data Structures tutorial series. We are going to learn about different data structures like array, linked list, queue, stack, tree, graph, etc.
In Computer Science, Data Structure is a way of Processing, Retrieving, Organising and Storing of data.
Data Structure is about a collection of data, the relationship that exists between the data values and the operations that can be performed on the data.
An Abstract Data Type is a data type that defines what operations can be performed on the data and what results will be produced by those operations without specifying how data will be stored or manipulated. It allows us to focus on the behaviour of the data rather than on the implementation.
For example, a Stack is an ADT and we can perform operations like adding items and removing items in a LastInFirstOut (LIFO) order. Similarly, a Queue is another ADT and it allows for the addition and removal of items in a FirstInFirstOut (FIFO) order.
So, ADT tells us about what type of operations can be performed while data structure tells us how to perform the operations.
There are two types of Data structures  Primitive and NonPrimitive.
The Primitive data structure consists of numbers and charactes and involves data types that are provided by the programming languages like integer
, character
, float
, boolean
.
The NonPrimitive data structures are derieved from the Primitive data structures. They consists of a collection of data that can be homogeneous (same data type) or heterogeneous (different data type). NonPrimitive data structures are of two types  Linear and NonLinear.
Linear data structures store data in a sequential order. Examples are Arrays, Stacks, Queues, Linked List etc.
NonLinear data structures store data in a nonsequential order. Examples are Tree and Graph.
Data structures can also be static and dynamic in terms of size. Static data structures have a fixed size and their size is set at compile time. Whereas, Dynamic data structures have a dynamic size and their size is allocated at run time.
Data Structure


+ Primitive
 
 + Character, Boolean, Integer, Float


+ NonPrimitive

+ Linear
 
 + Array, Queue, Stack, Linked List


+ NonLinear

+ Tree, Graph
Following are the common operations that we perform on a data structure.