Professional Documents
Culture Documents
om
iii) The prefix notation is also known as
v) Structure in C is an
b) ADT
d) none of these
a) Linked list
b) Stack
c) Queue
d) none of these
vii) A graph G with n nodes bipartite if it contains
a) n edges
b) a cycle of odd length
c) no cycle of odd length
2
d) n edges
viii) The ratio of items present in the hash table, to the total table size is called
om
b) O ( log2 n ) d) O ( nlog2 n )
x) A is an array of size m * n, stored in the row major order. If the address of the first element in
the array is M, the address of the element A (i, j) (A (0, 0) ) is the first element of the array and
each element occupies one location in memory that is
t.c
a) M + (i – j) * m + j – 1 c) M + (j – 1) * m + i -1
bu
b) M + i * m + j d) M + (i -1) * n + j -1
xi) In which collision processing method, it is not required to detect a given list position, if it is
occupied or not?
yw
a) Quadratic c) Rehashing
b) Linked d) None of these
m
a) -1, 0, 1 c) -2, 0, 2
b) -2, 0, 1 d) -1, 0, 2
8. Distinguish between linear and non-linear data structure with suitable example.
9. a) Represent the following polynomial by linked list (show the diagram only) :
5 3
9x + 3x – 8x + 15
b) Convert the following:
i) A + ( ( ( B – C ) * ( D – E ) + F ) / G ) $ ( H – I ) [POSTFIX]
ii) ABC - / DEF + * + [PREFIX]
om
c) Write an algorithm to add two polynomials.
10. a) What is a graph? Find out the shortest path between all pairs of nodes in the given graph by
Kruskal’s algorithm.
t.c
bu
yw
11. a) In a 2-tree, if E be the external path length, P be the internal path length and Q be the
number of vertices that are not leaves, then prove that
E = P + 2Q
c) The in-order & pre-order traversal sequence of nodes in a binary tree are given below:
In-order: E A C K F H D B G
Pre-order: F A E K C D H G B
12. a) Construct the following Queue of characters where Queue is a circular array which is
allocated six memory cells.
FRONT = 2 REAR = 4 QUEUE: _ , A, C, D, _, _
Describe the Queue as the following operations take place:
i) F is added to the Queue
ii) Two letters are from the Queue
iii) K, L, M are added to the Queue
iv) Two letters are deleted from the Queue
v) R is added to the Queue
vi) One letter is deleted from the Queue
b) What is tail recursion? How is it different from ordinary recursion? What are the difference
between iteration and recursion?
c) Write the push( ) and pop( ) functions for a stack after describing the Data-Structure clearly.
om
13. a) Why is hashing referred as a heuristic search method?
b) Write an algorithm for heap sort algorithm.
t.c
c) Define a B-Tree. Insert the following keys into a B-Tree of order 3. (i.e. the B-tree is a 3-way
tree)
A F B K H M E S R C L
bu
N U P
yw
m