Nothing Special   »   [go: up one dir, main page]

Data Structure Mcqs Single File

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

1) How can we describe an array in the best possible way?

a. The Array shows a hierarchical structure.


b. Arrays are immutable.
c. Container that stores the elements of similar types
d. The Array is not a data structure

2) How can we initialize an array in C language?


a. int arr[2]=(10, 20)
b. int arr(2)={10, 20}
c. int arr[2] = {10, 20}
d. int arr(2) = (10, 20)
3) Which of the following highly uses the concept of an array?
a. Binary Search tree
b. Caching
c. Spatial locality
d. Scheduling of Processes
4) Which one of the following is the process of inserting an element in the stack?
a. Insert
b. Add
c. Push
d. None of the above
5) When the user tries to delete the element from the empty stack then the condition is said
to be a ____
a. Underflow
b. Garbage collection
c. Overflow
d. None of the above
6) If the size of the stack is 10 and we try to add the 11th element in the stack then the
condition is known as___

a. Underflow
b. Garbage collection
c. Overflow
d. None of the above
7) Which one of the following is not the application of the stack data structure
a. String reversal
b. Recursion
c. Backtracking
d. Asynchronous data transfer

8) Which data structure is mainly used for implementing the recursive algorithm?

a. Queue
b. Stack
c. Binary tree
d. Linked list
9) Which data structure is required to convert the infix to prefix notation?
a. Stack
b. Linked list
c. Binary tree
d. Queue
10) Which of the following is the infix expression?
a. A+B*C
b. +A*BC
c. ABC+*
d. None of the above
11) Which of the following is the prefix form of A+B*C?
a. A+(BC*)
b. +AB*C
c. ABC+*
d. +A*BC
12) Which of the following is not the correct statement for a stack data structure?
a. Arrays can be used to implement the stack
b. Stack follows FIFO
c. Elements are stored in a sequential manner
d. Top of the stack contains the last inserted element
13) What is the outcome of the prefix expression +, -, *, 3, 2, /, 8, 4, 1?
a. 12
b. 11
c. 5
d. 4

14) The minimum number of stacks required to implement a stack is __

a. 1
b. 3
c. 2
d. 5

15) Which one of the following node is considered the top of the stack if the stack is
implemented using the linked list?

a. First node
b. Second node
c. Last node
d. None of the above

16) The time complexity of enqueue operation in Queue is __

a. O(1)
b. O(n)
c. O(logn)
d. O(nlogn)

17) Which of the following that determines the need for the Circular Queue?

a. Avoid wastage of memory


b. Access the Queue using priority
c. Follows the FIFO principle
d. None of the above

18) Which of the following is the time complexity to search an element in the linked list?
a. O(1)
b. O(n)
c. O(logn)
d. O(nlogn)

19) Which of the following statement is not true about the doubly linked list?

a. We can traverse in both the directions.


b. It requires extra space
c. Implementation of doubly linked list is easier than the singly linked list
d. It stores the addresses of the next and the previous node

20) Which one of the following techniques is not used in the Binary tree?

a. Randomized traversal
b. Preorder traversal
c. Postorder traversal
d. Inorder traversal

21) Why do we prefer Red Black tree over AVL tree?

a. Red Black trees are not strictly balanced


b. Red black tree requires lesser rotations than AVL tree.
c. AVL tree needs more space to store the balance factor.
d. Both b and c

22) A linear data structure in which insertion and deletion operations can be performed from
both the ends is___

a. Queue
b. Deque
c. Priority queue
d. Circular queue

23) Which data structure is the best for implementing a priority queue?
a. Stack
b. Linked list
c. Array
d. Heap

24) Which of the following principle is used if two elements in the priority queue have the
same priority?

a. LIFO
b. FIFO
c. Linear tree
d. None of the above

25) Which of the following statement is not true regarding the priority queue?

a. Processes with different priority can be easily handled


b. Easy to implement
c. Deletion is easier
d. None of the above

26) Which of the following options is not true about the Binary Search tree?

a. The value of the left child should be less than the root node
b. The value of the right child should be greater than the root node.
c. The left and right sub trees should also be a binary search tree
d. None of the above

27) How can we define a AVL tree?

a. A tree which is binary search tree and height balanced tree.


b. A tree which is a binary search tree but unbalanced tree.
c. A tree with utmost two children
d. A tree with utmost three children

28) Which of the following satisfies the property of the Red Black tree?
a. A tree which is a binary search tree but not strictly balanced tree.
b. A node must be either Red or Black in color and root node must be black.
c. A tree with maximum three children
d. Both a and b

29) What would be the color of newly created node while inserting a new element in a Red
black tree?

a. Black, if the new node is not a root node


b. Red, if the new node is not a root node
c. Black, if the new node is a root node
d. Both b and c

30) Which of the following statements for a simple graph is correct?

a) Every path is a trail

b) Every trail is a path

c) Every trail is a path as well as every path is a trail

d) Path and trail have no relation

31) In a simple graph, the number of edges is equal to twice the sum of the degrees of the
vertices.

a) True

b) False

32) A connected planar graph having 6 vertices, 7 edges contains _____________ regions.

a) 15

b) 3

c) 1
d) 11

33) If a simple graph G, contains n vertices and m edges, the number of edges in the Graph
G'(Complement of G) is ___________

a) (n*n-n-2*m)/2

b) (n*n+n+2*m)/2

c) (n*n-n-2*m)/2

d) (n*n-n+2*m)/2

34) Which of the following properties does a simple graph not hold?

a) Must be connected

b) Must be unweighted

c) Must have no loops or multiple edges

d) Must have no multiple edges

35) What is the maximum number of edges in a bipartite graph having 10 vertices?

a) 24

b) 21

c) 25

d) 16

36) Which of the following is true?

a) A graph may contain no edges and many vertices

b) A graph may contain many edges and no vertices


c) A graph may contain no edges and no vertices

d) A graph may contain no vertices and many edges

37) For a given graph G having v vertices and e edges which is connected and has no cycles,
which of the following statements is true?

a) v=e

b) v = e+1

c) v + 1 = e

d) v = e-1

38) For which of the following combinations of the degrees of vertices would the connected
graph be eulerian?

a) 1,2,3

b) 2,3,4

c) 2,4,5

d) 1,3,5

39) A graph with all vertices having equal degree is known as a __________

a) Multi Graph

b) Regular Graph

c) Simple Graph

d) Complete Graph

40) Which of the following ways can be used to represent a graph?

a) Adjacency List and Adjacency Matrix


b) Incidence Matrix

c) Adjacency List, Adjacency Matrix as well as Incidence Matrix

d) No way to represent

41) A connected planar graph having 6 vertices, 7 edges contains _____________ regions.

A. 15
B. 3
C. 1
D. 11
42) On which of the following statements does the time complexity of checking if an edge
exists between two particular vertices is not, depends?

A. Depends on the number of edges


B. Depends on the number of vertices
C. Is independent of both the number of edges and vertices
D. It depends on both the number of edges and vertices
43) The degree sequence of a simple graph is the sequence of the degrees of the nodes in
the graph in decreasing order. Which of the following sequences can not be the degree
sequence of any graph?
I. 7, 6, 5, 4, 4, 3, 2, 1
II. 6, 6, 6, 6, 3, 3, 2, 2
III. 7, 6, 6, 4, 4, 3, 2, 2
IV. 8, 7, 7, 6, 4, 2, 1, 1

A. I and II
B. III and IV
C. IV only
D. II and IV
44) What is the maximum number of edges in a bipartite graph having 10 vertices?

A. 24
B. 21
C. 25
D. 16
45) Possible number of labelled simple Directed, Pseudo and Multigarphs exist having 2
vertices?

A. 3, Infinite, 4
B. 4, 3, Infinite
C. 4, Infinite, infinite
D. 4, Infinite, Infinite

46) The most efficient algorithm for finding the number of connected components in an
undirected graph on n vertices and m edges has time complexity.
(A) \theta(n)
(B) \theta(m)
(C) \theta(m + n)
(D) \theta(mn)

A. A
B. B
C. C
D. D

47) If the elements '1', '2', '3' and '4' are added in a stack, so what would be the order for
the removal?

a. 1234
b. 2134
c. 4321
d. None of the above

48) Which one of the following node is considered the top of the stack if the stack is
implemented using the linked list?

a. First node
b. Second node
c. Last node
d. None of the above

49) Which one of the following is the overflow condition if a circular queue is implemented
using array having size MAX?

a. rear= MAX-1
b. rear=MAX
c. front=(rear+1) mod max
d. None of the above
50) Which of the following option is true if implementation of Queue is from the linked
list?

a. In enqueue operation, new nodes are inserted from the beginning and in dequeue
operation, nodes are removed from the end.
b. In enqueue operation, new nodes are inserted from the end and in dequeue
operation, nodes are deleted from the beginning.
c. In enqueue operation, new nodes are inserted from the end and in dequeue
operation, nodes are deleted from the end.
d. Both a and b

1. Which data structure allows deleting data elements from front and inserting at rear?
a. Stacks
b. Queues
c. Deques
d. Binary search tree
2. Identify the data structure which allows deletions at both ends of the list but insertion at
only one end.
a. Input-restricted deque
b. Output-restricted deque
c. Priority queues
d. None of above
3. Which of the following data structure is non-linear type?
a. Strings
b. Lists
c. Stacks
d. None of above
4. Which of the following data structure is linear type?
a. Strings
b. Lists
c. Queues
d. All of above
5. To represent hierarchical relationship between elements, which data structure is
suitable?
a. Deque
b. Priority
c. Tree
d. All of above
6. A binary tree whose every node has either zero or two children is called
a. Complete binary tree
b. Binary search tree
c. Extended binary tree
d. None of above
7. The depth of a complete binary tree is given by
a. Dn = n log2n
b. Dn = n log2n+1
c. Dn = log2n
d. Dn = log2n+1
8. When representing any algebraic expression E which uses only binary operations in a 2-
tree,
a. the variable in E will appear as external nodes and operations in internal nodes
b. the operations in E will appear as external nodes and variables in internal nodes
c. the variables and operations in E will appear only in internal nodes
d. the variables and operations in E will appear only in external nodes
9. A binary tree can easily be converted into q 2-tree
a. by replacing each empty sub tree by a new internal node
b. by inserting an internal nodes for non-empty node
c. by inserting an external nodes for non-empty node
d. by replacing each empty sub tree by a new external node
10. When converting binary tree into extended binary tree, all the original nodes in binary
tree are
a. internal nodes on extended tree
b. external nodes on extended tree
c. vanished on extended tree
d. None of above
11. The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
a. ABFCDE
b. ADBFEC
c. ABDECF
d. ABDCEF
12. Which of the following sorting algorithm is of divide-and-conquer type?
a. Bubble sort
b. Insertion sort
c. Quick sort
d. All of above
13. An algorithm that calls itself directly or indirectly is known as
a. Sub algorithm
b. Recursion
c. Polish notation
d. Traversal algorithm
14. In a binary tree, certain null entries are replaced by special pointers which point to nodes
higher in the tree for efficiency. These special pointers are called
a. Leaf
b. branch
c. path
d. thread
15. The in order traversal of tree will yield a sorted listing of elements of tree in
a. Binary trees
b. Binary search trees
c. Heaps
d. None of above
16. In a Heap tree
a. Values in a node is greater than every value in left sub tree and smaller than right sub tree
b. Values in a node is greater than every value in children of it
c. Both of above conditions applies
d. None of above conditions applies
17. In a graph if e=[u, v], Then u and v are called
a. endpoints of e
b. adjacent nodes
c. neighbors
d. all of above
18. A connected graph T without any cycles is called
a. a tree graph
b. free tree
c. a tree
d. All of above
19. In a graph if e=(u, v) means
a. u is adjacent to v but v is not adjacent to u
b. e begins at u and ends at v
c. u is processor and v is successor
d. both b and c
20. If every node u in G is adjacent to every other node v in G, A graph is said to be
a. isolated
b. complete
c. finite
d. strongly connected

Answers:
1. Which data structure allows deleting data elements from front and inserting at rear?
b. Queues
2. Identify the data structure which allows deletions at both ends of the list but insertion at
only one end.
a. Input-restricted deque
3. Which of the following data structure is non-linear type?
d. None of above
4. Which of the following data structure is linear type?
d. All of above
5. To represent hierarchical relationship between elements, which data structure is
suitable?
c. Tree
6. A binary tree whose every node has either zero or two children is called
c. Extended binary tree
7. The depth of a complete binary tree is given by
d. Dn = log2n + 1
8. When representing any algebraic expression E which uses only binary operations in a 2-
tree,
a. the variable in E will appear as external nodes and operations in internal nodes
9. A binary tree can easily be converted into q 2-tree
d. by replacing each empty sub tree by a new external node
10. When converting binary tree into extended binary tree, all the original nodes in binary
tree are
a. internal nodes on extended tree
11. The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
c. ABDECF
12. Which of the following sorting algorithm is of divide-and-conquer type?
c. Quick sort
13. An algorithm that calls itself directly or indirectly is known as
b. Recursion
14. In a binary tree, certain null entries are replaced by special pointers which point to nodes
higher in the tree for efficiency. These special pointers are called
d. thread
15. The in order traversal of tree will yield a sorted listing of elements of tree in
b. Binary search trees
16. In a Heap tree
b. Values in a node is greater than every value in children of it
17. In a graph if e=[u, v], Then u and v are called
d. all of above
18. A connected graph T without any cycles is called
d. All of above
19. In a graph if e=(u, v) means
d. both b and c
20. If every node u in G is adjacent to every other node v in G, A graph is said to be
b. complete
1. In ............................. ; for any node n, every descendant node's value in the left subtree of
n is less than the value of n and every descendant node's value in the right subtree is greater
than the value n.
A) binary tree
B) binary search tree
C) AVL tree
D) binary heap tree
2. For finding a node in a ....................., at each stage we ideally reduce the number of nodes
we have to check by half.
A) binary tree
B) binary search tree
C) AVL tree
D) binary heap tree
3. In the best case of BST, the time is on the order of ........................, but in the worst case it
requires linear time.
A) log₂n
B) n
C) log₂(n+1)
D) n+1

4. ...................... of binary search tree starts by visiting the current node, then its left child and
then its right child.
A) Preorder traversal
B) In-order traversal
C) Linear traversal
D) Post-order traversal
5. The order with which the nodes are inserted affects the running time of the .........................
search algorithm.
A) AVL Tree
B) Red-Black Tree
C) Binary Search Tree
D) Binary Heap Tree
6. .................... of binary search tree starts by visiting the current node's left child, then its right
child and finally the current node itself.
A) Preorder
B) In-order
C) Linear
D) Post-order
7. With an ideal balance, the running time for inserts, searches and deletes, even in the worst
case is ...........................
A) log₂n
B) n
C) log₂(n+1)
D) n+1
8. In binary search tree, a ...................... exists if starting from some node n there exists a path
that returns to n.
A) cycle
B) node
C) root
D) subtree
9. In binary search tree, a ........................ rooted to node n is the tree formed by imaging
node n was a root.
A) cycle
B) node
C) root
D) subtree
10. ................................. is a binary search tree whose left subtree and right subtree differ in
height by at most 1 unit and whose left and right subtrees are themselves AVL trees.
A) Red-Black Tree
B) AVL Tree
C) Binary Head Tree
D) A-A Tree
11. ..................... is a binary search tree whose leaves are external nodes.
A) Red-Black Tree
B) AVL Tree
C) Binary Heap Tree
D) A-A Tree
12. Which of the following is/are properties of red-black tree.
i) every node is either red or black ii) the root is red iii) If a node is red, then both its children
are black iv) every leaf is black
A) i, ii and iii only
B) i, iii and iv only
C) i, ii and iv only
D) All i, ii, iii and iv
13. A lemma is a red-black tree with n internal nodes has height at most ...............
A) 2lg(n)
B) 2n
C) 2lg(n+1)
D) n+1
14. While inserting into ................................, insertions are done at a leaf and will replace an
external node with an internal node with two external children.
A) red-black tree
B) AVL tree
C) binary search tree
D) binary heap tree
15. For an AVL tree ................................ is the additional piece of information which indicates
if the difference in height between the left and right subtree is the same or if not, which of the
two subtrees has height one unit larger.
A) tree factor
B) balance factor
C) additional factor
D) unit factor
16. ..................... is a complete binary tree, that is completely filled except possibly at the
bottom level.
A) Red-Black Tree
B) AVL Tree
C) Binary Heap Tree
D) A-A Tree
17. In a .......................... for every node X with a parent P, the key in P is less than or equal to
the key in X.
A) red-black
B) AVL
C) binary search
D) binary heap
18. An insertion into a ............................. is performed by inserting the new node in the
location referenced by next in the array and then "sifting it up" by comparing the key of the
newly inserted node with the key of the parent.
A) red-black
B) AVL
C) binary search
D) binary heap
19. While deleting nodes from a binary heap, ...................... node is replaced by the last leaf in
the tree.
A) left leaf
B) right leaf
C) root
D) cycle
20. The worst case height of an AVL tree with n nodes is ...............
A) 2 lg n
B) 1.39 lg n
C) 1.44 lg n
D) 1.64 lg n
Answers

1. B) binary search tree


2. B) binary search tree
3. A) log₂n
4. A) Preorder traversal
5. C) Binary Search Tree
6. D) Post-order
7. A) log₂n
8. A) cycle
9. D) subtree
10. B) AVL Tree
11. A) Red-Black Tree
12. B) i, iii and iv only
13. C) 2lg(n+1)
14. A) red-black tree
15. B) balance factor
16. C) Binary Heap Tree
17. D) binary heap
18. D) binary heap
19. C) root
20.C) 1.44 lg n
__________________________________________________________________________
1) The post order traversal of binary tree is DEBFCA. Find out the pre order traversal.
A. ABFCDE B. ADBFEC C. ABDECF D. ABDCEF
2) While converting binary tree into extended binary tree, all the original nodes in binary tree
are .......
A. Internal nodes on extended tree
B. External nodes on extended tree
C. Vanished on extended tree
D. Intermediate nodes on extended tree
3) The in-order traversal of tree will yield a sorted listing of elements of tree in ........
A. binary trees
B. binary search trees
C. heaps
D. binary heaps
4) In a binary tree, certain null entries are replaced by special pointers which point to nodes
higher in the tree for efficiency. These special pointers are called .........
A. Leaf
B. Branch
C. Path
D. Thread
5) In a head tree .....
A. values in a node is greater than every value every value in left sub tree and smaller than right
sub tree.
B. values in a node is greater than every value in children of it.
C. conditions.
D. terms.
6) The in order traversal of tree will yield a sorted listing of elements of tree in ....
A. Binary trees
B. Binary search trees
C. Merging
D. AVL Trees
7) In a graph if e=(u,v) means .......
A. u is adjacent to v but v is not adjacent to u.
B. e begins at u and ends at v
C. u is node and v is an edge.
D. both u and v are edges.
8) A binary tree whose every node has either zero or two children is called .........
A. Complete binary tree
B. Binary Search tree
C. Extended binary tree
D. E2 tree
9) If every node u in G is adjacent to every other node v in G,A graph is said to be ........
A. isolated
B. complete
C. finite
D. strongly connected.
10) The post order traversal of a binary tree is DEBFCA. Find out the pre order Traversal.
A. ABFCDE
B. ADBFEC
C. ABDECF
D. ABDCEF
11) In a graph if e=[u,v], then u and v are called
A. endpoints of e
B. adjacent nodes
C. neighbours
D. all of the above
12) In-order traversing a tree resulted E A C K F H D B G; the pre-order traversal would return.
A. FAEKCDBHG
B. FAEKCDHGB
C. EAFKHDCBG
D. FEAKDCHBG
13) A connected graph T without any cycles is called .
A. a tree graph
B. free tree
C. a tree
D. All of above
14) In linked representation of Binary trees LEFT[k] contains the ........ of at the node N, where
k is the location.
A. Data
B. Location and left child
C. Right child address
D. Null value
15) If every node u in G adjacent to every other node v in G, A graph is said to be
A. isolated B. complete C. finite D. strongly connected
16) Three standards ways of traversing a binary tree T with root R .......
A. Prefix, infix, postfix
B. Pre-process, in-process, post-process
C. Pre-traversal, in-traversal, post-traversal
D. Pre-order, in-order, post-order
17) A graph is said to be ....... if every node u in G is adjacent to every other node v in G.
A. Absolute B. Entire C. Inclusive D. Complete
18) In threaded binary tree ......... points to higher nodes in tree.
A. Info B. Root C. Threads D. Child
19) A graph is said to be ....... if its edges are assigned data.
A. Tagged B. Marked C. Lebeled D. Sticked
20) If node N is a terminal node in a binary tree then its .........
A. Right tree is empty
B. Left tree is empty
C. Both left & right sub trees are empty
D. Root node is empty
Answers:
1) C. ABDECF
2) A. Internal nodes on extended tree
3) B. binary search trees
4) D. Thread
5) B. values in a node is greater than every value in children of it.
6) B. Binary search trees
7) B. e begins at u and ends at v
8) C. Extended binary tree
9) B. complete
10) C. ABDECF
11) D. all of the above
12) B. FAEKCDHGB
13) D. All of above
14) A. Data
15) B. complete
16) D. Pre-order, in-order, post-order
17) D. Complete
18) C. Threads
19) C. Lebeled
20) C. Both left & right sub trees are empty
1) The operation of processing each element in the list is known as ......
A. sorting B. merging C. inserting D. traversal
2) Other name for directed graph is ..........
A. Direct graph B. Digraph C. Dir-graph D. Digraph
3) Binary trees with threads are called as .......
A. Threaded trees
B. Pointer trees
C. Special trees
D. Special pointer trees
4) Graph G is .............. if for any pair u, v of nodes in G there is a path from u to v or path
from v to u.
A. Leterally connected
B. Widely Connected
C. Unliterally connected
D. Literally connected
5) In Binary trees nodes with no successor are called ......
A. End nodes
B. Terminal nodes
C. Final nodes
D. Last nodes
6) A connected graph T without any cycles is called ........
A. free graph
B. no cycle graph
C. non cycle graph
D. circular graph
7) Trees are said .......... if they are similar and have same contents at corresponding nodes.
A. Duplicate B. Carbon copy C. Replica D. Copies
8) A connected graph T without any cycles is called a ........
A. A tree graph
B. Free tree
C. A tree d
D. All of the above
9) Every node N in a binary tree T except the root has a unique parent called the ......... of N.
A. Antecedents
B. Predecessor
C. Forerunner
D. Precursor
10) In a graph if E=(u,v) means ......
A. u is adjacent to v but v is not adjacent to u
B. e begins at u and ends at v
C. u is processor and v is successor
D. both b and c
11) Sequential representation of binary tree uses ........
A. Array with pointers
B. Single linear array
C. Two dimentional arrays
D. Three dimentional arrays
12) In a graph if e=[u,v], Then u and v are called ........
A. End points of e
B. Adjacent nodes
C. Neighbours
D. All of the above
13) TREE[1]=NULL indicates tree is ........
A. Overflow B. Underflow C. Empty D. Full
14) A binary tree whose every node has either zero or two children is called .......
A. complete binary tree
B. binary search tree
C. extended binary tree
D. data structure
15) Linked representation of binary tree needs ......... parallel arrays.
A. 4 B. 2 C. 3 D. 5
16) The depth of complete binary tree is given by ......
A. Dn = n log2n
B. Dn= n log2n+1
C. Dn = log2n
D. Dn = log2n+1
17) In a 2-tree, nodes with 0 children are called ............
A. Exterior node
B. Outside node
C. Outer node
D. External node
18) Which indicates pre-order traversal?
A. Left sub-tree, Right sub-tree and root
B. Right sub-tree, Left sub-tree and root
C. Root, Left sub-tree, Right sub-tree
D. Right sub-tree, root, Left sub-tree
19) In a extended-binary tree nodes with 2 children are called ........
A. Interior node
B. Domestic node
C. Internal node
D. Inner node
20) A terminal node in a binary tree is called ............
A. Root B. Leaf C. Child D. Branch
Answers:
1) D. traversal
2) D. Digraph
3) A. Threaded trees
4) C. Unliterally connected
5) B. Terminal nodes
6) A. free graph
7) D. Copies
8) D. All of the above
9) B. Predecessor
10) D. both b and c
11) A. Array with pointers
12) D. All of the above
13) C. Empty
14) C. extended binary tree
15) C. 3
16) D. Dn = log2n+1
17) D. External node
18) C. Root, Left sub-tree, Right sub-tree
19) C. Internal node
20) B. Leaf
MTB College Sadiqabad
Course Title: Data Structures and Algorithms MCS 2nd Semester
Course Code: CSIT-21201 Date:
TYPE: Objectives Obtained marks: ___________
Objective Part

Choose the best option:

1. Arrays are best data structures


A) for relatively permanent collections of data
B) for the size of the structure and the data in the structure are constantly changing
C) for both of above situation
D) for none of above situation
2. If the number of records to be sorted is small, then …… sorting can be efficient.
A) Merge
B) Heap
C) Selection
D) Bubble
3. The situation when in a linked list START=NULL is ….
A) Underflow
B) Overflow
C) Houseful
D) Saturated
4. Which of the following is not a limitation of binary search algorithm?
A) Must use a sorted array
B) Requirement of sorted array is expensive when a lot of insertion and deletions are needed
C) There must be a mechanism to access middle element directly
D) Binary search algorithm is not efficient when the data elements more than 1500.
5. A …….. Is a linear list in which insertions and deletions are made to from either
end of the structure?
A) Circular queue
B) Random of queue
C) Priority
D) Dequeue
6. The complexity of sorting algorithm measures the …… as a function of the
number n of items to be sorter.
A) Average time
B) Running time
C) average-case complexity
D) case-complexity
7. Merging k sorted tables into a single sorted table is called ……
A) k way merging
B) k th merge
C) k+1 merge
D) k-1 merge
8. In a priority queue, insertion and deletion takes place at ………………
A) front, rear end
B) only at rear end
C) only at front end
D) any position
9. The worst case occur in linear search algorithm when …….
A) Item is the last element in the array or item is not there at all
B) Item is not in the array at all
C) Item is the last element in the array
D) Item is somewhere in the middle of the array
10. Which of the following statement is false?
A. Arrays are dense lists and static data structure.
B. Data elements in linked list need not be stored in adjacent space in memory
C. Pointers store the next data element of a list.
D. Linked lists are collection of the nodes that contain information part and next pointer.

11. Which of these best describes an array?


a) A data structure that shows a hierarchical behavior
b) Container of objects of similar types
c) Arrays are immutable once initialized
d) Array is not a data structure
12. What is the value of the postfix expression 6 3 2 4 + – *:
a) 1
b) 40
c) 74
d) -18
13 Which data structure is used for implementing recursion?
a) Queue
b) Stack
c) Array
d) List
14:The elements of an array are stored successively in memory cells because
a). by this way computer can keep track only the address of the first element and the
addresses of other elements can be calculated
b) the architecture of computer memory does not allow arrays to store other than serially
c) both of above
d). none of above
15. A …….. is a linear list in which insertions and deletions are made to from
either end of the structure.
a) circular queue
b) random of queue
c) priority
d) dequeue
16. The complexity of sorting algorithm measures the …… as a function of the
number n of items to be sorter.
a) average time
b) running time
c) average-case complexity
d) case-complexity
17: What is the ' next ' field of structure node in the Queue?
a) Results into the storage of queue elements.
b) Results into the storage of address of next node by holding the next element of queue.
c)Results into the memory allocation of data elements to next node.
d) Results into the address allocation data elements to next node.

18. In a priority queue, insertion and deletion takes place at ………………


a) front, rear end
b) only at rear end
c) only at front end
d) any position
19.What should be the value of rear (end) if the queue is full (elements are
completely occupied )?
a) 1
b) - 1
c)MAX + 1
d) MAX - 1
e) zero (null)
20. Which of the following statement is false?
a) Arrays are dense lists and static data structure.
b) Data elements in linked list need not be stored in adjacent space in memory
c) Pointers store the next data element of a list.
d) Linked lists are collection of the nodes that contain information part and next pointer.

21. Which of these best describes an array?


a) A data structure that shows a hierarchical behavior
b) Container of objects of similar types
c) Container of objects of mixed types
d) All of the mentioned
22. Entries in a stack are “ordered”. What is the meaning of this statement?
a) A collection of stacks is sort able
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
23. Consider the usual algorithm for determining whether a sequence of
parentheses is balanced.
Suppose that you run the algorithm on a sequence that contains 2 left parentheses and 3 right
parentheses (in some order).
The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the
computation?
a) 1
b) 2
c) 3
d) 4 or more
24. What is the value of the postfix expression 6 3 2 4 + – *:
a) Something between -5 and -15
b) Something between 5 and -5
c) Something between 15 and 100
d) Something between 5 and 15
25. The prefix form of A-B/ (C * D ^ E) is?
a) -A/B*C^DE
b) -ABCD*^DE
c) -/*^ACBDE
d) -A/BC*^DE

26. In linked list each node contain minimum of two fields. One field is data field
to store the data second field is?
a) Pointer to character
b) Pointer to integer
c) Node
d) Pointer to node

27. Which of the following application makes use of a circular linked list?
a) Undo operation in a text editor
b) Recursive function calls
c) Allocating CPU to resources
d) All of the mentioned
28. What is a memory efficient double linked list?
a) Each node has only one pointer to traverse the list back and forth
b) The list has breakpoints for faster traversal
c) An auxiliary singly linked list acts as a helper list to traverse through the doubly linked list
d) None of the mentioned
29. If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted
one at a time, in what order will they be removed?
a) DCBA
b) ABCD
c) DCAB
d) ABDC
30. Queues serve major role in
a) Simulation of recursion
b) Simulation of arbitrary linked list
c) Simulation of limited resource allocation
d) All of the mentioned

31. How do you initialize an array in C?


a) int arr[3] = (1,2,3);
b) int arr(3) = {1,2,3};
c) int arr[3] = {1,2,3};
d) int arr(3) = (1,2,3);
32. In a stack, if a user tries to remove an element from empty stack it is called
_______?
a) Underflow
b) Empty collection
c) Overflow
d) Garbage Collection
33 The prefix form of an infix expression (p + q) – (r * t) is?
a) + pq – *rt
b) – +pqr * t
c) – +pq * rt
d) – + * pqrt
34. What is the value of the postfix expression 6 3 2 4 + – *:?
a) Something between -5 and -15
b) Something between 5 and -5
c) Something between 15 and 100
d) Something between 5 and 15
35. The prefix form of A-B/ (C * D ^ E) is?
a) -A/B*C^DE
b) -ABCD*^DE
c) -/*^ACBDE
d) -A/BC*^DE
36. Which of the following is not an application of priority queue?
a) Huffman codes
b) Interrupt handling in operating system
c) Undo operation in text editors
d) Bayesian spam filter
37. What is the need for a circular queue?
a) effective usage of memory
b) easier computations
c) to delete elements based on priority
d) implement LIFO principle in queues
38.The type of expression in which operator succeeds its operands is?
a) Infix Expression
b) Prefix Expression
c) Postfix Expression
d) Both Prefix and Postfix Expressions
39.A mathematical-model with a collection of operations defined on that model is
called?
a) Data Structure
b) Abstract Data Type
c) Primitive Data Type
d) Algorithm
40. Queues serve major role in?
a) Simulation of recursion
b) Simulation of arbitrary linked list
c) Simulation of limited resource allocation
d) All of the mentioned

You might also like