31. CONTENTS
● Previous Year Question Discussion
○ 042/2016-Tradesman in CS
○ 143/2016-Tradesman in IT
○ 114/2016-Instructor in IT
○ 151/2016-Tradesman InCS
○ 002/2012..Lecturer in CS
49. ● An m-ary tree is a rooted tree in which each node has no more
than m children ie at most m children.
● A full m-ary tree is an m-ary tree where within each level every
node has either 0 or m children ie internal node has m children
and leaf node has 0.
● For a full N -ary tree
L =(N –1) *I+1.
Where ‘I’- internal nodes, ‘L’-Leaf nodes‘
60. Quicksort
● Partition Exchange sort
● Uses divide and conquer concept.
● Partition is based on a pivot element(key element)
● Here pivot element is one of the elements in the list( May be first
or last or median or any random element ).
● The list is divided into two partitions such that "all elements to
the left of pivot are smaller than the pivot and all elements to the
right of pivot are greater than or equal to the pivot".
● Best and average case time complexity is O(n log n)
● Worst case time complexity is O(n2)
64. 140/2016-Assistant Professor in IT
Ans: B
[The maximum number of nodes possible in a binary tree of height
‘h’ is 2
h+1-1. Or 2
h-1 ]
[The minimum number of node possible in a binary tree of height ‘h’
is h+1. Or h ]
66. 140/2016-Assistant Professor in IT
Ans:Option D [Hint: Worst case complexity for deletion operation in
singly linked list is O(n). But here the pointer to the deleting node is
given .So O(1) ]
68. 140/2016-Assistant Professor in IT
Ans:Option B [Number of Leaf Nodes(n0) =Number of Internal nodes
with 2 children(n2) +1]
Number of Leaf Nodes =10 +1
Number of Leaf Nodes =11
80. B-tree
● A balanced m-way search tree which maintains sorted data.
● A node in B tree can have more than one key and more than 2
children.
● All the leaf node must be at the same level.
81. ● Properties of B tree with order m:
○ Every node has maximum m children
○ Minimum children--leaf--0
Root--2
Internal nodes----ceil(m/2)
○ Every node has maximum m-1 keys
○ Minimum keys-- ----Root--1
All other nodes----ceil(m/2)-1
94. Explanation
Address of A[I] = B + W * (I – LB)
I = Subset of element whose address to be found,
B = Base address,
W = Storage size of one element store in any array(in byte),
LB = Lower Limit/Lower Bound of subscript(If not specified assume
zero).
123. Complete graph
● A complete graph is a graph with N vertices and an edge
between every two vertices.
● Number of edges in a complete graph with n vertices is n(n−1)/2
edges.
● Eg:k6(No.of edges-15)
After removed 3
edges k6
became planar.
124. CompleteBipartiteGraph:
● A graph G = (V, E) is called a complete bipartite graph if its
vertices V can be partitioned into two subsets V1 and V2 such
that each vertex of V1 is connected to each vertex of V2.
● The number of edges in a complete bipartite graph is m.n as
each of the m vertices is connected to each of the n vertices.
● Eg: k3,3
Itis not planar. So remove
one edge ,then it will
become planar.
126. Explanation
● &represents address.
● Array name by itself is the base address,ie the array name is a pointer which
points to the starting address of the array or base address of array.
129. Euler Graph
● An Euler Graph is a connected graph that contains an Euler
Circuit. An Euler circuit is a Euler path which starts and ends on
the same vertex. An Euler path is a path in a graph that visits
every edges exactly once .
● Let G be a connected graph. Then G is Eulerian if and only if
every vertex of G has even degree.
138. ● An abstract data type (ADT) is a mathematical model for data
types.
● An abstract data type is defined by its behavior (semantics) from
the point of view of a user, of the data, specifically in terms of
possible values, possible operations on data of this type, and the
behavior of these operations.
● This mathematical model contrasts with data structures, which
are concrete representations of data, and are the point of view of
an implementer, not a user.