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

11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

DS MidTerm 2021

Hi, Sourabh. When you submit this form, the owner will see your name and email address.

Consider the following array of elements

<89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100>

The minimum number of interchanges needed to convert it into a max-heap


is
(1 Point)

(A) 4

(B) 5

(C) 2

(D) 3

If the MAX_SIZE is the size of the array used in the implementation of circular
queue. How is rear manipulated while inserting an element in the queue?

(1 Point)

A. rear=(rear%1)+MAX_SIZE

B. rear=rear%(MAX_SIZE+1)

C. rear=(rear+1)%MAX_SIZE

D. rear=rear+(1%MAX_SIZE)

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 1/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

The type of expression in which operator succeeds its operands is?


(1 Point)

A) Infix Expression

B) Prefix Expression

C) Postfix Expression

D) Both Prefix and Postfix Expressions

What is the time complexity of searching for an element in a circular linked


list?

(1 Point)

a) O(n)

b) O(nlogn)

c) O(1)

d) O(n2)

Let the following circular queue can accommodate maximum six elements
with the following data.What will happen after ADD O operation takes place?

front = 2 rear = 4

queue = _______; L, M, N, ___, ___


(1 Point)

A. front = 2 rear = 5    queue = ______; L, M, N, O, ___

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 2/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

B. front = 3 rear = 5     queue = L, M, N, O, ___

C. front = 3 rear = 4     queue = ______; L, M, N, O, ___

D. front = 2 rear = 4     queue = L, M, N, O, ___

Matrix with maximum zero entries is termed as sparse matrix. It can be


represented as:
(1 Point)

a) Lower triangular matrix

b) Upper Triangular matrix

c) Tri-diagonal matrix

d) All of the above

In C programming, when we remove an item from bottom of the stack, then 


(1 Point)

A - The stack will fall down

B - Stack will rearranged items.

C - It will convert to LIFO

D - This operation is not allowed.

Which of the following is false about a circular linked list?

(1 Point)

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 3/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

a) Every node has a successor

b) Time complexity of inserting a new node at the head of the list is O(1)

c) Time complexity for deleting the last node is O(n)

d) We can traverse the whole circular linked list by starting from any point

Each node of a tree stores a data value and has zero or more pointers
pointing to the other nodes of the tree, which are also known as its__________.
(1 Point)

A. Child nodes

B. Leaf nodes

C. Root

D. None of the above

10

Entries in a stack are “ordered”. What is the meaning of this statement?


(1 Point)

A) A collection of stacks is sortable

B) Stack entries may be compared with the ‘<‘operation

C) The entries are stored in a linked list

D) There is a Sequential entry that is one by one

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 4/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

11

What is the value of the postfix expression 6 3 2 4 + – *?

(1 Point)

a) 1

b) 40

c) 74

d) -18

12

Consider a binary max-heap implemented using an array. Which one of the


following array represents a binary max-heap?
(1 Point)

(A) 25,12,16,13,10,8,14

(B) 25,14,13,16,10,8,12

(C) 25,14,16,13,10,8,12

(D) 25,14,12,13,10,8,16

13

Which one of the following is not the application of the stack data structure?
(1 Point)

A. String reversal

B. Recursion

C. Backtracking

D. Asynchronous data transfer

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 5/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

14

If the queue is implemented with a linked list, keeping track of a front


pointer and a rear pointer, which of these pointers will change during an
insertion into a non-empty queue ?

(1 Point)

A) Neither of the pointers changes.

B) Only front pointer changes.

C) Only rear pointer changes.

D) Both of the pointers changes.

15

Which of the following statement about binary tree is CORRECT?


(1 Point)

a) Every binary tree is either complete or full

b) Every complete binary tree is also a full binary tree

c) Every full binary tree is also a complete binary tree

d) A binary tree cannot be both complete and full

16

The main advantage of using AVL tree is:


(1 Point)

a. insertion takes less time

b. deletion takes less time

c. searching takes less time


file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 6/18
11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

d. construction takes less time

17

In pre-order traversal, the root node is visited before traversing


its________subtrees
(1 Point)

a.Left

b.Right

c.Both (a) and (b)

d.None of the above

18

The nodes belonging to the same parent node are known as_______.
(1 Point)

a. Sibling nodes

b. Parent nodes

c. Child nodes

d. None of the above

19

In a linear array, only _________ data elements can be stored


(1 Point)

a) homogeneous

b) heterogeneous

c) Sorted

d) None of the above


file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 7/18
11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

20

If (rear== maxsize-1) rear = 0; else rear = rear+1; is required in :


(1 Point)

A) Linear queue

B) Circular Queue

C) Stack

D) Dequeue

21

Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4.

Now consider that a value 35 is inserted into this heap. After insertion, the
new heap is

(1 Point)

(A) 40, 30, 20, 10, 15, 16, 17, 8, 4, 35

(B) 40, 35, 20, 10, 30, 16, 17, 8, 4, 15

(C) 40, 30, 20, 10, 35, 16, 17, 8, 4, 15

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 8/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

(D) 40, 35, 20, 10, 15, 16, 17, 8, 4, 30

22

In a full binary tree if there are L leaves, then total number of nodes N are?
(1 Point)

a) N = 2*L

b) N = L + 1

c) N = L – 1

d) N = 2*L – 1

23

Which type of tree traversal in the binary search tree will give us a sorted
list?
(1 Point)

(A) In order Traversal

(B) Post Order Traversal

(C) Pre order Traversal

(D) Level Order Traversal

24

_________ is a data declaration packaged together with the operations that


are meaningful for the data type.
(1 Point)

a) Array

b) Linked List

c) ADT

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 9/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

d) BST

25

In case of insertion into a linked queue, a node borrowed from the __________
list is inserted in the queue.
(1 Point)

A. AVAIL

B. FRONT

C. REAR

D. None of the mentioned

26

Which of the following is true about BST’s in-order traversal?


(1 Point)

a. It occurs in non increasing order

b. It occurs in increasing order

c. it occurs in random fashion

d. none of the above

27

. Given an array [ 1..8, 1..5, 1..7 ] of integers. Calculate address of element


A[5,3,6], by using rows methods, if BA=900?
(1 Point)

a) 1122

b) 1120

c) 1102

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 10/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

d) 1022

28

Evaluate and write the result for the following postfix expression
abc*+de*f+g*+ where a=1, b=2,  

    c=3, d=4, e=5, f=6, g=2.


(1 Point)

A. 61

B. 59

C. 60

D. 55

29

Consider the following statements:

S1: A queue can be implemented using two stacks.

S2:  A stack can be implemented using two queues.

Which of the following is correct ?

(1 Point)

A) S1 is correct and S2 is not correct.

B) S1 is not correct and S2 is correct.

C)both S1 and S2 is correct.

D) Both S1 and S2 is incorrect.

30

In linked representation of stack the null pointer of the last node in the list
signals ……….
(1 Point)

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 11/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

A. Beginning of the stack

B. Bottom of the stack

C. Middle of the stack

D. In between some value

31

Any node in the path from the root to the node is called
(1 Point)

A) Successor node

B) Ancestor node

C) Internal node

D) None of the above

32

The linked representation of a binary tree is implemented by using a linked


list having an_________.
(1 Point)

a. Info part

b. Two pointers- left and right

c. Both (a) and (b)

d. One pointer

33

Assuming that the height of a tree with a single node is zero, then what will
be the height of any AVL tree having 14 nodes?
(1 Point)

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 12/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

(A) 2

(B) 3

(C) 4

(D) 5

34

Which of the following operation can not be performed on Array data


structure?
(1 Point)

a) Splitting

b) Searching

c) Merging

d) All of the above

35

Calculate the balance factor and decide whether the given tree is balanced
or not.

(1 Point)

a. Yes

b. No

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 13/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

c. Can’t say

d. May be

36

The seven element A,B,C,D, E, F and G are pushed onto a stack in reverse
order, i.e., starting from G. The stack is popped five times and each element
is inserted into a queue. Two elements are deleted from the queue and
pushed back onto the stack. Now, one element is popped from the stack.
The popped item is __________.
(1 Point)

1) A

2) B

3) F

4) G

37

What is the result of the following operation?

       Top (Push (S, X))


(1 Point)

A) X

B) X+S

C) S

D) XS

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 14/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

38

In array A(-2:2, 2:22) B(1:8, -5:5, -10:5) compute following:

The length of each dimension and the number of elements in A


(1 Point)

a) 11,16, 1408

b) 5, 12, 60

c) 5,21, 105

d) 5, 13, 65

39

In array B(1:8, -5:5, -10:5) compute following:

The length of each dimension and the number of elements in B


(1 Point)

a) 11,16, 1408

b) 5, 12, 60

c) 5,21, 105

d) 5, 13, 65

40

Operands of an arithmetic expression when converted into a tree will always


be at
(1 Point)

a. Internal nodes

b. root

c. leaves
file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 15/18
11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

d. all of the above

41

........... level is where the model becomes compatible executable code.


(1 Point)

a) Abstract Level

b). Application Level

c). Implementation Level

d). All of the above

42

. If the level order traversal of the AVL tree is as following:

50 40 60 30 45 55 10

What would be the order after deleting 55


(1 Point)

a. 50 40 60 30 10 45

b. 40 30 50 10 45 60

c. 30 40 50 10 45 60

d. 40 30 50 60 10 45

43

.Application of data structure in queue is :

(1 Point)

A) Level wise printing of tree.

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 16/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

B) Implementation of priority queues.

C) Function call implementation

D) Depth first search in a graph.

44

Heap sort is an implementation of ..... using a descending priority queue.


(1 Point)

insertion sort

selection sort

bubble sort

merge sort

45

The postfix form of the expression (A+ B)*(C*D- E)*F / G is?


(1 Point)

A) AB+ CD*E – FG /**

B) AB + CD* E – F **G /

C) AB + CD* E – *F *G /

D) AB + CDE * – * F *G /

Submit

This content is created by the owner of the form. The data you submit will be sent to the form owner. Microsoft is
not responsible for the privacy or security practices of its customers, including those of this form owner. Never give
out your password.

Powered by Microsoft Forms | Privacy and cookies | Terms of use

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 17/18


11/26/21, 11:26 AM DS MidTerm 2021 (IT - 3I789 Lab Group 7)

file:///C:/Users/soura/Desktop/(1) Assignments _ Microsoft Teams_files/AssignmentsResponsePage.html 18/18

You might also like