Ec8393 - Fundamentals of Data Structures in C: Linear Datastructures
Ec8393 - Fundamentals of Data Structures in C: Linear Datastructures
net
Linear DataStructures
PART-A
www.AUNewsBlog.net
www.AUNewsBlog.net
i) Trees
ii) Graphs.
8.What do you mean by Abstract Data Types?
Classes encapsulate all the essential properties of the objects that are to be
created. Since the classes use the concept of data abstraction, they are known as
Abstract Data Types (ADT).
STACK QUEUE
Insertion and deletion are made at one end. Insertion at one end rear and deletion at
other end front.
The element inserted last would be The element inserted first would be
www.AUNewsBlog.net
www.AUNewsBlog.net
Operations such as insertion and deletion Insertion and deletions are easier and
are ineffective since the memory needs only one pointer assignment.
locations need to be moved up and down
respectively.
www.AUNewsBlog.net
www.AUNewsBlog.net
Disadvantages:
d. Nodes of a linked list cannot be accessed directly. To access a particular node
accessing should start only from the beginning.
e. To store a single data, along with data, memory must be allocated for a pointer also,
which wastes memory.
Tree Structures
PART-A
1. Define Tree.
A Tree is a collection of one or more nodes with a distinct node called the root , while
remaining nodes are partitioned as T1 ,T2, ..,Tk , K≥ 0 each of which are sub trees, the
edges of T1,T2,…,Tk are connected the root.
www.AUNewsBlog.net
www.AUNewsBlog.net
www.AUNewsBlog.net
www.AUNewsBlog.net
A complete binary tree is a tree in which every non-leaf node has exactly two
children not necessarily to be on the same level.
10.Define a right-skewed binary tree.
A right-skewed binary tree is a tree,which has only right child nodes.
www.AUNewsBlog.net
www.AUNewsBlog.net
20. Give the pre & postfix form of the expression (a + ((b*(c-e))/f).
www.AUNewsBlog.net
www.AUNewsBlog.net
UNIT-IV Graphs
1. Define Graph.
A Graph G, consists of a set of vertices V, and a set of edges E.V is a finite non-empty
set consisting of vertices of vertices of the graph. The set of edges E consists of a pair of
vertices from the vertex set.
2.What is undirected graph.
If an edge between any two nodes in a graph is not directionally oriented, a graph
is called as undirected graph. It is also called as unqualified graph.
a b
a b
5 11
c
www.AUNewsBlog.net
www.AUNewsBlog.net
a b
c d
a b
www.AUNewsBlog.net
www.AUNewsBlog.net
a b
a b
c d
P1 = ((a,b),(b,e))
P2 = ((a,c),(c,d),(d,e))
a b
c dwww.AUNewsBlog.net
www.AUNewsBlog.net
A B
C D
A B C D
0 1 1 1
0 0 0 1
0 0 0 1
1 1 1 0
www.AUNewsBlog.net