CST 3 Sem Data Structures 307 3 N Jun 2022

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

June 2022

878 DATA STRUCTURES


307/3(N)

Full Marks: 60
Time Allowed: 3 Hours
following questions from Group-A, B & Cas directed.
Answer the
GROUP-A
alternative (Any 10) Ix 10-10
1. Choose the correct
Structs c) Trees
)Which data structure is defined
as a collection of similar data elements? a) Arrays b)
d) Graphs.
element on the stack? a) Pop b)Push c) Peek d) isEmpty.
ii) Which function places
an

you initialize an array in C? a) int arr[3] (1,2,3);


How do
iii) int arr(3) =
(1,2,3);
{1,2,3};c) int arr|[3]= {1,2,3};d)
int arr(3)
=
b)
of a) Infix expression b) Prefix Expression c) Postfix
polish notation is the other
name
iv) Reverse
expression d) None of these.
when- a) Rear
an array of size MAX_SIZE, gets full
v) A normal queue, if implemented using rear +1 d) Rear =
front
MAX_SIZE 1 b) Front (rear +1)mod MAX_SIZE
-
= c) Front

6 3 24+- *? a) 1 b) 40 c) 74 d)-18
vi) What is the value of the postfix expression
be performed in the Selection Sort algorithm for
vii) What is the maximum number of swaps that can
'n' number of elements? a) n-1 b) n c) 1 d)n^

data d) none of these


vii). If TOP=MAX-1, then the stack is a) full b) empty c) contains some

BST? A) Preorder b) Inorder


traversal outputs the data in sorted order in a
ix) Which of the following
c) Postorder d) Level order
We want to create a heap using the elements. The time complexity of
x) An array consists of n elements.
building a heap will be in order of a) O(n*n*logn)b) O(n*logn) c) O(n*n) d) O(n *logn *logn)
then the stack
element into a stack already having five elements and a stack size of 5,
xi) Pushing an
flow
becomes a) Overflow, b) Crash, c) Underflow, d) User

In the connected graph G, what is the value of rad(G) and diam(G)? a) 3, 2 b) 2, 2 c) 3, 3 d) 2,3
xii) given
Ix 10=10
2. Fill in the blanks (any ten):

i) A tree is data structure.


The function is kept in header file.
ii) clrscr()
no children is calleda node
iii) A tree node that has is called
iv) Breaking a program into several functions
v) The #define pi 3.14 is a statement.
vi) Adding an element in a queue is called operation.
vii) The pointer without a data type is_
viii) A loop inside another loop is called
ix) stores the non-homogeneous data elements
x) Process of removing an element from stack is called
xi) Circular Queue is also known as
xii) In the stack, if a user tries to remove an element from the empty stack, then it called
xil) The complexity to delete a node from the end of the linked list is -

Xiv) is the logical container of a data item.


xv) The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum
number of nodes in a binary tree of height h is .
xvi) The malloc function returns when the allocation fails.

3. Answerthe following questions (any ten): 1x 10=10


i) What is FIFO?
ii) What is a leaf node?
ii) What is BST?
iv) Memory space for an array is allocated in compile-time or in run time?
v) Define De-Queue?
vi) What is Backtracking?
vii) Explain about dummy header.
vii) Write the method of Bubble sort
ix) What is the difference between a PUSH and a POP?
x)What is a degree of a node of a tree?
xi) Write the full form of MST.
xii) What are the disadvantages of linked list?
xii) Define queue full condition.
xiv) What is rear of a queue?.
GROUP-B
4. Answerthe questions (any six) 2x6-12

i) What is complete binary tree?


1) Write prefix form of the expression: (A+B"C)-(D/E)
ii) What do you understand by radix sort?
iv) Write two applications of queue. Find out the post-order traversal of
traversal of a binary search tree.
v) 10, 5, 1,7,40, 50 is given preorder
the same tree?
vi) What is doubly linked list?
vii) What is hasing?
vii) What is quick sort?
ix) What sparx matrix?
x) Give infix notation with an example. overflow?
stack underflow and stack
xi) What do you understand by
xii) What is collision resolution technique?
GROUP-C

6x1
5. Answer the question (any one):
Data Structures?
the differences between linear and nonlinear
a) What is Data Structure? Write down
b) What is Explain with a suitable example.
ADT?
c)Define a graph. Explain different representation of graph.
6x
6. Answer the question (any one): function.
a) Explain Priority queue and its types.
What will be the value of A (1,5) by using Ackerman
in an AVL tree
b) Write an algorithm to insert a node

2
c) Given the Pre-order and In-order traversal of binary tree. Draw the tree representation and write its
Post-order traversal-
Pre-order: B D E J C F G K
In-order: I B E J A F C K G

7. Answer the question (any one) 6x1


a) Write pseudocode to implement a circular queue using an array
b) Explain the Polynomial equation of linked list: 3x*+ 2x- 5x+2 =0
c) Write a recursive algorithm for binary tree traversal with an example.

You might also like