Savitribai Public University Data Structure MCQ | SPPU Data Structure MCQ | Data Structure

Data Structure


1. A Mathematical model with a collection of operation defined on that model is called

A) Data Structure

B) Abstract Data type

C) Primitive Data Type

D) Algorithm

Answer : B) Abstract Data type

 

2. In an ADT

A) Data are declared

B) Operations are defined

C) Data and Operations are encapsulated

D) All of the above

Answer : D) All of the above

 

3. A data structure is an aggregation of

A) Atomic data

B) Composite data

C) Atomic and composite data into a set with define relationship

D) None

Answer : C) Atomic and composite data into a set with define relationship

 

4. ……………. Is/ are the linear data structures.

A) Array

B) Linked list

C) String

D) All

Answer : D) All

 

5. …….. is a non-linear data structures.

A) linked list

B) stack

C) Graph

D) Queue

Answer : C) Graph

 

6. Time complexity of a program refer to :

A) Complexity involved with the input time of a program

B) Complexity involved in space mission and control

C) Amount of time a program needs to run for completion

D) None of the above

Answer : C) Amount of time a program needs to run for completion

 

7. Space complexity of an algorithm is the maximum amount of  …….. required by it during execution.

A) Memory space

B) Operations

C) Time

D) None of the above

Answer : A) Memory space

 

8. An algorithm that indicates the amount of temporary storage required for running the algorithm, i.e., the amount of memory needed by the algorithm to run to completion is termed as …………..

A) Big Oh o(f)

B) Big Omega (f)

C) Space complexity

D) Time complexity

Answer : C) Space complexity

 

9. To verity whether a function grows faster or slower than the other function, we have some asymptotic or mathematical notations, which is/are

A) Big Omega(f)

B) Big Oh O (f)

C) Both(a) and (b)

D) None of these

Answer : C) Both(a) and (b)

 

10. A function in which f(n) is Oh(g(n)), if there exist positive values k and c such that f(n)>=c*g(n), for all n>=k. This notation defines a lower bound for a function f(n).

A) Big Oh O(f)

B) Big Omega (f)

C) Both (a) and (b)

D) None of the above

Answer : B) Big Omega (f)

 

11. An algorithm that requires ………….. operations to complete its task on n data elements is said to have a linear runtime.

A) 2n+1

B) 3n2+3n++2

C) n3+9

D) 10

Answer : A) 2n+1

 

12. The complexity of adding two matrices of other m*n is

A) m + n

B) mn

C) m2n2

D) log(m+n)

Answer : B) mn

 

13. What does it mean when we say that an algorithm x is asymptotically more efficient then y?

A) x will always be a better choice for small inputs

B) x will always be a better choice for large inputs

C) x will always be a better choice for small inputs

D) x will always be a better choice for all inputs

Answer : B) x will always be a better choice for large inputs

 

14. which of the following data structure store the homogeneous data elements ?

A) Arrays

B) Records

C) Pointers

D) None of the above

Answer : A) Arrays

 

15. Arrays are best data structures………..

A) for relatively permanent collections of data

B) the size of the structure and the data in the structure are constantly changing

C) for both of a above situation

D) None of the above situation

Answer : A) for relatively permanent collections of data

 

16. The memory address of the first element of an array is called ….

A) floor address

B) foundation address

C) first address

D) base address

Answer : D) base address

 

17. which of the following expressions access the (I,j)th of a m x n matrix stored in column major form?

A) n x (i-1)+j

B) m x (j-1)+i

C) m x (n-j)+j

D) n x (m-i)+j

Answer : B) m x (j-1)+i

 

18. The smallest element of an array’s index is called its

A) Lower bound

B) Upper bound

C) Range

D) Extraction

Answer : A) Lower bound

 

19. Which of the following is also called as partition exchange sort?

A) Bubble

B) Insertion

C) merge

D) Quick

Answer : D) Quick

 

20. What is an internal/ in-place sorting algorithm?

A) Algorithm that users tape or disk during the sort

B) Algorithm that user main memory during the sort

C) Algorithm that involves swapping

D) Algorithm that are considered in place

Answer : B) Algorithm that user main memory during the sort

 

21. What is an external/out-place sorting algorithm?

A) Algorithm that user tape or disk during the sort

B) Algorithm that user main memory during the sort

C) Algorithm that involves swapping

D) Algorithm that are considerd ‘in place’

Answer : A) Algorithm that user tape or disk during the sort

 

22. A sorting technique is called stable if it…….

A) Takes O(n log n ) times

B) Maintains the relative order of occurrence of non-distinct elements

C) User divide-and-conquer paradigm

D) Takes O(n) space

Answer : B) Maintains the relative order of occurrence of non-distinct elements

 

23. Which of the following is not stable sort?

A) Bubble sort

B) Insertion sort

C) Merge sort

D) Quick sort

Answer : D) Quick sort

 

24. Which of the following is not an internal sorting algorithm?

A) Bubble sort

B) Insertion sort

C) Merge sort

D) Quick sort

Answer : C) Merge sort

 

25. Which of the following is example of an external sorting algorithm?

A) Bubble sort

B) Insertion sort

C) Merge sort

D) Quick sort

Answer : C) Merge sort

 

26. The complexity of Bubble sort algorithm is  …..

A) O(n)

B) O(log n)

C) O(n)2

D) O(n log n)

Answer : B) O(log n)

 

27. If the given input array is sorted or nearly sorted, which of the following algorithms gives the best performance ?

A) Insertion sort

B) Quick sort

C) Merge sort

D) None of the above

Answer : A) Insertion sort

 

28. In a circularly linked list organization, insertion of a record involves the modification of

A) 0  pointer

B) 1 pointer

C) 2 pointer

D) 3 pointer

Answer :  C) 2 pointer

 

29. The concatenation of two lists is to be performed in O(1) time, which of the following implementation of a list should be used?

A) Singly liked list

B) Doubly liked list

C) Circular double liked list

D) Array implementation of list

Answer : C) Circular double liked list

 

30. Which of the following operations is performed more efficiently by double liked list than by linear liked list?

A) Deleting nodes whose location is given

B) Searching an unsorted list for a given item.

C) Inserting a node after the node with a given location

D) Traversing the list to process each node.

Answer : A) Deleting nodes whose location is given

 

31. consider the liked list of n elements. What is the time taken to insert an element after an element pointed by some pointer?

A) O(1)

B) O(log2n)

C) O(n)

D) O(n log2n)

Answer : A) O(1)

 

32. ………. Is an ordered collection of data in which each element contains the location of the next element known as ?

A) Array

B)  Record

C)  liked list

D)  node

Answer : C)  liked list

 

33. Which does an empty linked list consist?

A) a variable 

B)  two nodes

C) data and a link

D) a null head pointer

Answer : D) a null head pointer

 

34. In the last node of the circular linked list the link field contains?

A) Null

B)Pointer to next node

C) Pointer to first Node

D) Pointer to data item

Answer : C) Pointer to first Node

 

35.In a circular liked list :

A) Components are all liked together in some sequential manner.

B) There is no beginning and no end.

C) components are arranged hierarchically.

D) Forward and backward traversal within the list permitted

Answer : B) There is no beginning and no end.

 

36. What is the time complexity to count the number of elements in the linked list?

A) O(1)

B) O(n)

C) O(log n)

D) O(n2)

Answer : B) O(n)

 

37. A stack is ……….

A) Linear data structure

B) Non-linear data structure

C) Built-in data structure

D) None of this

Answer : A) Linear data structure

 

38. A stack is linear data structure in which data is stored and retrieved in a ……………….

A) Last out First in

B)  Last in First Out

C) First in First Out

D) Last Out Last in

Answer : B)  Last in First Out

 

39. Elements are added at which position of the stack?

A)Bottom

B)  Middle

C) Top

D)  Garbage Collection

Answer : C) Top

 

40. In a stack, if a user tries to remove an element form empty stack it is called …..

A) Underflow

B)  Empty collection

C) Overflow

D)  Garbage Collection

Answer : A) Underflow


41. The memory address of the fifth element of an array can be calculated by formula._____

A)  Local (array[5]=Base(Array)+w(5-lower bound),where w is the number of words per memory cell for the array)

B)  Local (array[5]=Base(Array[5])+(5-lower bound),where w is the number of words per memory cell for the array)

C) Local (array[5]=Base(Array[4])+w(5-lower bound),where w is the number of words per memory cell for the array)

D)  None of the above

Answer : A)  Local (array[5]=Base(Array)+w(5-lower bound),where w is the number of words per memory cell for the array)

 

42. pushing an element into stack already having five elements and stack size of 5, then stack becomes

A) Over flow

B) Crash

C) Underflow

D) User flow

Answer : A) Over flow

 

43. Process of inserting an element in stack is called _____

A) Create

B)Push

C) Evaluation

D) Pop

Answer : B)Push

 

44.Process of removing an element from stack is called______

A) Create

B) Push

C) Evaluation

D) Pop

Answer : D) Pop

 

45. The following sequence of operations is performed on a stack push(1), push(2), pop, push(1),push(2), pop, pop, pop, push(2), pop. The sequence of pooped out values are ________.

A) 2,2,1,2

B) 2,2,1,2,2

C) 2,1,2,2,1

D) 2,1,2,2,2

Answer : A) 2,2,1,2

 

46. The data structure required to check whether an expression contains balanced parenthesis is ______

A) Stack

B)  Tree

C) Queue

D)  Array

Answer : A) Stack

 

47. In evaluation the arithmetic expression 2*3-(4+5) using stacks to evaluates its equivalent post fix form, which of the following stake configuration is not possible?

 

 

4

 

A)   6

 

5

4

 

B)   6

 

 

9

 

C)   6

 

9

3

 

D)   2

Answer :

 

9

3

 

D)   2

 

48. stack A has the entries a, b, c (with a on top). Stake B is empty. An entry popped out of stake A can be printed immediately or pushed to stake B. An entry popped out of stake B can only be printed. In this agreement, which of the following permutations of a, b, and c are not possible?

A)  b a c

B)  b c a

C) c a b

D)  a b c

Answer : C) c a b

 

49. Stack can’t be used to ______

A) Evaluate the arithmetic expression in post fix form.

B)  Implement recursion.

C)  Convert a given arithmetic expression in infix form to its equivalent post fix form.

D) Allocate resources (like CPU) by the operating system.

Answer : D) Allocate resources (like CPU) by the operating system.

 

50. Which is the post fix expression for the following infix expression? A+B*(C+D)/F+D*E

A) AB+CD+*F/D+E*

B)  ABCD+*F/DE*+

C) A*B+CD/F*DE++

D) A+*BCD/F*DE++

Answer : B)  ABCD+*F/DE*+

 

51. The post fix form A+(B*c) is _______

A)  ABC+*

B)  ABC*+

C) AB+C*

D) AB*C+

Answer : B)  ABC*+

 

51. The Post fix form of (A+(B)*C) is______

A) AB+C*

B)  ABC*++

C) ABC*C+

D) ABC+*

Answer : A) AB+C*

 

52. What is the post ix form of the following prefix *+AB-CD

A) AB+CD-*

B)  ABC+*-

C) AB+*CD-

D) AB++*CD-

Answer : A) AB+CD-*

 

53.  A linear list of elements in which deletion can be done form one end(front ) and insertion can take place only at the other end(rear) is known as ______

A) Stack

B)  Queue

C) Tree

D) Linked list

Answer : B)  Queue

 

54. A queue follows _______

A) FIFO(First In first out) Principle

B)   LIFO(Last in first out) Principle

C) Ordered Array

D) Linear Tree

Answer : A) FIFO(First In first out) Principle

 

55. The initial configuration of a queue is A, B, C, D (A is in the front end). To get the configuration D, C, B, A, One needs a minimum of _________

A)  2 deletions and 3 additions

B)  3 deletions and 2 additions

C) 3 deletions and 3 additions

D) 3 deletions and 4 additions

Answer : C) 3 deletions and 3 additions

 

56.A simple queue, if implemented using an array of size MAX_SIZE, get full when

A) Rear = MAX_SIZE-1

B)  Front=(rear+1)mod MAX_SIZE

C) Front = rear +1

D) Rear = Front

Answer : A) Rear = MAX_SIZE-1

 

57. In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion into EMPTY queue?

A) Only front pointer

B)  Only year pointer

C) Both front and rear pointer

D) None

Answer:  C) Both front and rear pointer

 

58. In linked list implementation of a queue, where does a new element be inserted?

A) At the head of link list

B) At the tail of the link list

C) At the center position in the like list

D) None

Answer : B) At the tail of the link list

 

 59. In linked list implementation of a queue, front and rear pointers are tracked, Which of these pointers will change during an insertion into a NONEMPTY queue?

A) Only front pointer

B)  Only year pointer

C) Both front and rear pointer

D) None of the front and rear pointer

Answer : B)  Only year pointer

 

60. 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?

A) rear =(rear%1)+MAX_SIZE

B)   rear = rear%(MAX_SIZE+1)

C) rear=(rear+1)%MAX_SIZE

D) rear = rear+(1%MAX_SIZE)

Answer : C) rear=(rear+1)%MAX_SIZE

 

61. A circular queue is implemented using an array of size 10. The array index starts with 0, front is 6, and rear is 9. The inserting of next element takes place at the array index.

A) 0

B)  9

C) 7

D) 10

Answer : A) 0

 

62. If the MAX_SIZE is the size of the array used in the implementation of circular queue, array index start with 0, front point to the first elements in the queue, and rear point to the last element in the queue. Which of the following condition specify that circular queue is EMPTY?

A) Front =rear=0

B)  Front=rear=-1

C) Front=rear+1

D) Front(rear+1)%MAX_SIZE

Answer : B)  Front=rear=-1

 

63. An array of size MAX_SIZE is used to implement a circular queue. Front, Rear, and count are tracked. Suppose from is 0 and rear is MAX_SIZE -1. How many elements are present in the queue?

A) Zero

B)  One

C) MAX_SIZE-1

D) MAX_SIZE

Answer : D) MAX_SIZE

 

64. Children of same parent are called _______

A) Node

B)  Child Node

C) Sibling

D)  None of the above

Answer : C) Sibling

 

66. The number of edges from the root to the node is called ______ of the tree.

A) Height

B) Depth

C) Length

D) Width

Answer : B) Depth

 

67. The number of edges from the node tot the deepest leaf is called____ of the tree.

A) Height

B)  Depth

C) Length

D) Width

Answer : A) Height

 

68. If the post order traversal given (ab-cd*+) then the label of the nodes 1,2,3,4,5,6 will be _________

A) +,-,*,a, b, c, d

B)  a, -, b, +, c,*,d

C)  a, b, c, d, -,*,+

D) -, a, b, ++, *, c, d

Answer : C)  a, b, c, d, -,*,+

 

69. The in degree of _____  a tree  is always zero.

A) any one

B)  a branch node

C)  the root node

D) a leaf node

Answer : D) a leaf node

 

70. A list of integers is read in, one at a time and a binary search tree is constructed. Next the tree is traversed and the integers are printed. Which traversal would print result in the original order of input?

A) Pre Order

B)  Post order

C)  In order

D) None of the above

Answer: B) post order

 

71. A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is ______

A) log2 n

B)  n-1

C)  n

D) 2n

Answer : B)  n-1

 

72. A binary tree in which every none-leaf node has none-empty left and right sub trees is called a strictly binary tree. Such a tree with 10 leaves_______

A)  cannot have more then 1 nodes

B)   has exactly 19 nodes

C)  has exactly 17 nodes

D) cannot have more than 17 nodes

Answer : A)  cannot have more then 1 nodes

 

73. The depth of complete binary tree with n nodes in _________

A) log2(n+1)-1

B)  log2 n

C)  log2(n-1)+1

D)  log2 n+1

Answer : D)  log2 n+1

 

74. The number of binary trees with 3 nodes which when traversed in post order gives the sequence  A,B,C is__________.

A) 3

B)  9

C)  7

D) 5

Answer : D) 5

 

75. A graph is a collection of _________.

A) Rows and columns

B) Vertices and edges

C) Equations

D) None of these

Answer : B) Vertices and edges

 

76.The degree of any vertex of graph is __________

A) The number of edges incident with vertex

B)  Number of vertex in a graph

C) Number of vertices adjacent to that vertex

D) Number of edges in a graph

Answer : A) The number of edges incident with vertex

 

77. A vertex with degree on in a graph is called_______

A) A leaf

B)  Pendant vertex

C) Adjacency list

D) None

Answer : B)  Pendant vertex

 

78. The maximum degree of any vertex in a simple graph with  n vertices is __________

A) n-1

B) n+1

C) 2n-1

D) N

Answer : A) n-1

 

79. The number of distinct simple graph with up to 3 nodes is ____

A) 15

B) 10

C) 7

D) 9

Answer : A) 15

 

80. Which of the following ways can be used to represent a graph ?

A) Adjacency Matrix

B) Adjacency List

C) Adjacency multi-list

D) All of the above

Answer : D) All of the above

 

81. The data structure used in standard implementation of Breadth First Search is ?

A) stack

B) Queue

C) Linked List

D) Tree

Answer : B) Queue

 

82. Depth First Search is equivalent to which of the traversal in the Binary Trees?

A) Pre- Order Traversal

B) Post – Order Traversal

C) Level- Order Traversal

D) In- Order Traversal

Answer : A) Pre- Order Traversal

 

83. The data structures used in standard implementation of Depth First Search is ?

A) Stack

B) Queue

C) Linked List

D) Tree

Answer : A) Stack

 

84. In most of the cases, topological sort starts from a node which has _____

A) Maximum Degree.

B) Minimum Degree.

C) Any Degree

D) Zero Degree

Answer : D) Zero Degree

Savitribai Public University Data Structure MCQ | SPPU Data Structure MCQ | Data Structure Savitribai Public University Data Structure MCQ | SPPU Data Structure  MCQ | Data Structure Reviewed by technical_saurabh on February 23, 2021 Rating: 5

No comments:

Powered by Blogger.