Data Structure
Data Structure
Home > Bank & Insurance > IBPS-SO :: IT O cer > Computer > Article
Dear Aspirant,
Today we are covering the topics of Data Structures for IBPS Specialist O cer
2017 Exam. Data Structure is a way of collecting and organising data in such a way
that we can perform operations on these data in an effective way.
Data Structure
A data structure is a specialised way for organising and storing data in memory, so
that one can perform operations on it.
For example:
We have data player's name "Dhoni" and age 35. Here "Dhoni" is of String data type
and 35 is of integer data type.
Now we can organise this data as a record like Player record.
We can collect and store player's records in a le or database as a data structure.
IBPS Clerk Combo Pack 2018- Test Series on Latest Pattern - Attempt Now
Available in Hindi & English, Latest Pattern with All India Rank among thousands
of Aspirants
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 1/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Linked List
Tree
Graph
Stack, Queue etc.
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 2/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Stack
A stack is an ordered collection of items into which new items may be inserted and
from which items may be deleted at one end, called the TOP of the stack. It is a
LIFO (Last In First Out) kind of data structure.
Operations on Stack:
Push: Adds an item onto the stack. PUSH (s, i); Adds the item i to the top
of stack.
Pop: Removes the most-recently-pushed item from the stack. POP (s);
Removes the top element and returns it as a function value.
size(): It returns the number of elements in the queue.
isEmpty(): It returns true if queue is empty.
Implementation of Stack: A stack can be implemented using two ways: Array and
Linked list.
But since array sized is de ned at compile time, it can't grow dynamically.
Therefore, an attempt to insert/push an element into stack (which is implemented
through array) can cause a stack over ow situation, if it is already full.
Go, to avoid the above mentioned problem we need to use linked list to implement
a stack, because linked list can grow dynamically and shrink at runtime.
Applications of Stack: There are many applications of stack some of the important
applications are given below.
Backtracking. This is a process when you need to access the most recent
data element in a series of elements.
Depth rst Search can be implemented.
Function Calls: Different ways of organising the data are known as data
structures.
Simulation of Recursive calls: The compiler uses one such data structure
called stack for implementing normal as well as recursive function calls.
Parsing: Syntax analysis of compiler uses stack in parsing the program.
Expression Evaluation: How a stack can be used for checking on syntax of an
expression.
In x expression: It is the one, where the binary operator comes between
the operands.
e. g., A + B * C.
Post x expression: Here, the binary operator comes after the operands.
e.g., ABC * +
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 3/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Reversing a List: First push all the elements of string in stack and then pop
elements.
Expression conversion: In x to Post x, In x to Pre x, Post x to In x, and
Pre x to In x
Implementation of Towers of Hanoi
Computation of a cycle in the graph
Queue
It is a non-primitive, linear data structure in which elements are added/inserted at
one end (called the REAR) and elements are removed/deleted from the other end
(called the FRONT). A queue is logically a FIFO (First in First Out) type of list.
Operations on Queue:
Enqueue: Adds an item onto the end of the queue ENQUEUE(Q, i); Adds the
item i onto the end of queue.
Dequeue: Removes the item from the front of the queue. DEQUEUE (Q);
Removes the rst element and returns it as a function value.
Circular Queue: In a circular queue, the rst element comes just after the last
element or a circular queue is one in which the insertion of a new element is done
at the very rst location of the queue, if the last location of queue is full and the
rst location is empty.
Note:- A circular queue overcomes the problem of unutilised space in linear queues
implemented as arrays.
We can make following assumptions for circular queue.
Front will always be pointing to the rst element (as in linear queue).
If Front = Rear, the queue will be empty.
Each time a new element is inserted into the queue, the Rear is incremented
by 1.
Rear = Rear + 1
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 4/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Each time, an element is deleted from the queue, the value of Front is
incremented
All Examsby one. STORE PRACTICE SEARCH
Front = Front + 1
Linked Lists
Linked list is a special data structure in which data elements are linked to one
another. Here, each element is called a node which has two parts
Each element (node) of a list is comprising of two items: the data and a reference
to the next node.
The Syntax of declaring a node which contains two elds in it one is for storing
information and another is for storing address of other node, so that one can
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 5/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Linked lists are dynamic data structure as they can grow and shrink during the
execution time.
E cient memory utilisation because here memory is not pre-allocated.
Insertions and deletions can be done very easily at the desired position.
Operations on Linked Lists: The following operations involve in linked list are as
given below
Singly Linked List: In this type of linked list, each node has only one address
eld which points to the next node. So, the main disadvantage of this type of
list is that we can’t access the predecessor of node from the current node.
Doubly Linked List: Each node of linked list is having two address elds (or
links) which help in accessing both the successor node (next node) and
predecessor node (previous node).
Circular Linked List: It has address of rst node in the link (or address) eld of
last node.
Circular Doubly Linked List: It has both the previous and next pointer in
circular manner.
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 6/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Tree
All Exams STORE PRACTICE SEARCH
Tree is a non-linear and hierarchical Data Structure.
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 7/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
for le system
Binary Tree:
A binary tree is a tree like structure that is rooted and in which each node has at
most two children and each child of a node is designated as its left or right child. In
this kind of tree, the maximum degree of any node is at most 2.
Any node N in a binary tree T has either 0, 1 or 2 successors. Level l of a binary tree
T can have at most 2 l nodes.
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 8/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Graphs
STORE
A graph is aAll Exams
collection PRACTICE
of nodes called vertices, and the connections SEARCH
between them,
called edges.
Directed Graph: When the edges in a graph have a direction, the graph is called a
directed graph or digraph and the edges are called directed edges or arcs.
Adjacency: If (u,v) is in the edge set we say u is adjacent to v.
Path: Sequence of edges where every edge is connected by two vertices.
Loop: A path with the same start and end node.
Connected Graph: There exists a path between every pair of nodes, no node is
disconnected.
Acyclic Graph: A graph with no cycles.
Weighted Graphs: A weighted graph is a graph, in which each edge has a weight.
Weight of a Graph: The sum of the weights of all edges.
Connected Components: In an undirected graph, a connected component is a
subset of vertices that are all reachable from each other. The graph is connected if
it contains exactly one connected component, i.e. every vertex is reachable from
every other. Connected component is a maximal connected subgraph.
Subgraph: subset of vertices and edges forming a graph.
Tree: Connected graph without cycles.
Forest: Collection of trees
In a directed graph, a strongly connected component is a subset of mutually
reachable vertices, i.e. there is a path between every two vertices in the set.
Weakly Connected component: If the connected graph is not strongly connected
then it is weakly connected graph.
Graph Representations: There are many ways of representing a graph:
Adjacency List
Adjacency Matrix
Incidence list
Incidence matrix
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 9/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Thanks,
GradeUp Team.
Posted by:
Vijay Kumar
Nov 21 Bank & Insurance
Related Posts
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 10/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
Hari Sep 27
All Exams STORE PRACTICE SEARCH
Hi frnds..if u have it o cer notes pelese send to me .my mail id
[email protected]
0 1
Udhayakumar M V Oct 22
please send IT O cer notes [email protected]
0 0
chandan Oct 24
Please send so/it notes at [email protected]
0 0
Write a comment
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 11/12
12/5/2018 IBPS (SO) I.T.Officer : Data Structure Study Notes
ABOUT US CONTACT US NEWS FAQ TERMS & CONDITIONS PRIVACY POLICY SITEMAP
AUTHORS
https://gradeup.co/ibps-so-i-t-officer-data-structure-study-notes-i-5406002a-b3bc-11e5-b245-f672ce3804fb 12/12