hicasct.files.wordpress.com file · web viewhindusthan college of atrs and science (autonomous)...

26
Hindusthan College of Atrs and Science (Autonomous) Data Structure Objective Questions 1.When determining the efficiency of algorithm, the space factor is measured by A)Counting the maximum memory needed by the algorithm B)Counting the minimum memory needed by the algorithm C)Counting the average memory needed by the algorithm D)Counting the maximum disk space needed by the algorithm ANSWER: A 2)The complexity of Bubble sort algorithm is A)O(n) B)O(log n) C)O(n2) D)O(n log n) ANSWER: C 3.Linked lists are best suited 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 ANSWER: D 4.If the values of a variable in one module is indirectly changed by another module, this situation is called A)internal change B)inter-module change C)side effect D)side-module update ANSWER: A 5.In linear search algorithm the Worst case occurs when A)The item is somewhere in the middle of the array B)The item is not in the array at all C)The item is the last element in the array

Upload: lybao

Post on 30-Mar-2019

215 views

Category:

Documents


0 download

TRANSCRIPT

Hindusthan College of Atrs and Science (Autonomous)Data Structure Objective Questions

1.When determining the efficiency of algorithm, the space factor is measured byA)Counting the maximum memory needed by the algorithmB)Counting the minimum memory needed by the algorithmC)Counting the average memory needed by the algorithmD)Counting the maximum disk space needed by the algorithm

ANSWER: A 2)The complexity of Bubble sort algorithm isA)O(n)B)O(log n)C)O(n2)D)O(n log n)

ANSWER: C

3.Linked lists are best suitedA)for relatively permanent collections of dataB)for the size of the structure and the data in the structure are constantly changingC)for both of above situationD)for none of above situation

ANSWER: D

4.If the values of a variable in one module is indirectly changed by another module, this situation is calledA)internal changeB)inter-module changeC)side effectD)side-module update

ANSWER: A

5.In linear search algorithm the Worst case occurs whenA)The item is somewhere in the middle of the arrayB)The item is not in the array at allC)The item is the last element in the arrayD)The item is the last element in the array or is not there at all

ANSWER: D

6.For an algorithm the complexity of the average case isA)Much more complicated to analyze than that of worst caseB)Much more simpler to analyze than that of worst caseC)Sometimes more complicated and some other times simpler than that of worst case

D)None or above

ANSWER: A

7.The complexity of merge sort algorithm isA)O(n)B)O(log n)C)O(n2)D)O(n log n)

ANSWER: B

8.The complexity of linear search algorithm isA)O(n)B)O(log n)C)O(n2)D)O(n log n)

ANSWER: C

9.When determining the efficiency of algorithm the time factor is measured byA)Counting microsecondsB)Counting the number of key operationsC)Counting the number of statementsD)Counting the kilobytes of algorithm

ANSWER: A

10.Which of the following data structure is linear data structure?A)TreesB)GraphsC)ArraysD)None of above

ANSWER: D

11.The elements of an array are stored successively in memory cells becauseA)by this way computer can keep track only the address of the first element and the addresses of other elements can be calculatedB)the architecture of computer memory does not allow arrays to store other than seriallyC)both of above D)none of above

ANSWER: A

12.Which of the following data structure is not linear data structure?A)ArraysB)Linked lists

C)Both of aboveD)None of above

ANSWER: C

13.The Average case occur in linear search algorithmA)When Item is somewhere in the middle of the arrayB)When Item is not in the array at allC)When Item is the last element in the arrayD)When Item is the last element in the array or is not there at all

ANSWER: B

14.Two main measures for the efficiency of an algorithm areA)Processor and memoryB)Complexity and capacityC)Time and spaceD)Data and space

ANSWER: D

15.Finding the location of the element with a given value is:A)TraversalB)SearchC)SortD)None of above

ANSWER: D

16.Which of the following case does not exist in complexity theoryA)Best caseB)Worst caseC)Average caseD)Null case

ANSWER: A

17.The operation of processing each element in the list is known asA)SortingB)MergingC)InsertingD)Traversal

ANSWER: C

18.Arrays are best data structuresA)for relatively permanent collections of dataB)for the size of the structure and the data in the structure are constantly changing

C)for both of above situationD)for none of above situation

ANSWER: B

19.Each array declaration need not give, implicitly or explicitly, the information aboutA)the name of arrayB)the data type of arrayC)the first data from the set to be storedD)the index set of the array

ANSWER: B

20.The complexity of Binary search algorithm isA)O(n)B)O(log )C)O(n2)D)O(n log n)

ANSWER: A

21.In a circular linked listA) Components are all linked 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 is permitted.

ANSWER: A

22.A linear collection of data elements where the linear node is given by means of pointer is called?A) Linked listB) Node listC) Primitive listD) None

ANSWER: C

23.Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?A) Deleting a node whose location in givenB) Searching of an unsorted list for a given itemC) Inverting a node after the node with given locationD) Traversing a list to process each node

ANSWER: B

24.Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head and tail pointer. Given the representation, which of the following operation can be implemented in O(1) time?i) Insertion at the front of the linked listii) Insertion at the end of the linked listiii) Deletion of the front node of the linked listiv) Deletion of the last node of the linked list

A) I and IIB) I and IIIC) I,II and IIID) I,II and IV

ANSWER: B

25.Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time?i) Insertion at the front of the linked listii) Insertion at the end of the linked listiii) Deletion of the front node of the linked listiv) Deletion of the last node of the linked list

A) I and IIB) I and IIIC) I,II and IIID) I,II and IV

ANSWER: C

26.The operation of processing each element in the list is known as ……A) sortingB) mergingC) insertingD) traversal

ANSWER: D

27.Other name for directed graph is ……….A) Direct graphB) DigraphC) Dir-graphD) Digraph

ANSWER: D

28.Binary trees with threads are called as …….A)Threaded trees

B)Pointer treesC)Special treesD)Special pointer trees

ANSWER: A

29.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) Literally connectedB) Widely ConnectedC) Unliterally connectedD) Literally connected

ANSWER: C

30.In Binary trees nodes with no successor are called ……A)End nodesB)Terminal nodesC)Final nodesD)Last nodes

ANSWER: B

31.A connected graph T without any cycles is called ……..A)free graphB)no cycle graphC)non cycle graphD)circular graph

ANSWER: A

32.Trees are said ………. if they are similar and have same contents at corresponding nodes.A) DuplicateB) Carbon copyC) ReplicaD) Copies

ANSWER: D

33.A connected graph T without any cycles is called a ……..A) A tree graphB) Free treeC) A tree dD) All of the above

ANSWER: D

34.Every node N in a binary tree T except the root has a unique parent called the ……… of N.A) Antecedents

B) PredecessorC) ForerunnerD) Precursor

ANSWER: B

35.In a graph if E=(u,v) means ……A) u is adjacent to v but v is not adjacent to uB) e begins at u and ends at vC) u is processor and v is successorD) both b and c

ANSWER: D

36.Sequential representation of binary tree uses ……..A) Array with pointersB) Single linear arrayC) Two dimensional arraysD) Three dimensional arrays

ANSWER: A

37.In a graph if e=[u,v], Then u and v are called ……..A) End points of eB) Adjacent nodesC) NeighborsD) All of the above

ANSWER: D

38.TREE[1]=NULL indicates tree is ……..A) OverflowB) UnderflowC) EmptyD) Full

ANSWER: C

39.A binary tree whose every node has either zero or two children is called …….A) complete binary treeB) binary search treeC) extended binary treeD) data structure

ANSWER: C

40.Linked representation of binary tree needs ……… parallel arrays.A) 4

B) 2C) 3D) 5

ANSWER:C

41.The depth of complete binary tree is given by ……A) Dn = n log2nB) Dn= n log2n+1C) Dn = log2nD) Dn = log2n+1

ANSWER: D

42.In a 2-tree, nodes with 0 children are called …………A) Exterior nodeB) Outside nodeC) Outer nodeD) External node

ANSWER: D

43.Which indicates pre-order traversal?A) Left sub-tree, Right sub-tree and rootB) Right sub-tree, Left sub-tree and rootC) Root, Left sub-tree, Right sub-treeD) Right sub-tree, root, Left sub-tree

ANSWER: C

44.In a extended-binary tree nodes with 2 children are called ……..A) Interior nodeB) Domestic nodeC) Internal nodeD) Inner node

ANSWER: C

45.A terminal node in a binary tree is called …………A) RootB) LeafC) ChildD) Branch

ANSWER: B

46.The no of external nodes in a full binary tree with n internal nodes is?

A) n B) n+1C) 2nD) 2n + 1

ANSWER: B

47.The difference between the external path length and the internal path length of a binary tree with n internal nodes is?A) 1B) nC) n + 1D) 2n

ANSWER: D

48.Suppose a binary tree is constructed with n nodes, such that each node has exactly either zero or two children. The maximum height of the tree will be?A) (n+1)/2B) (n-1)/2C) n/2 -1D) (n+1)/2 -1

ANSWER: B

49.Which of the following statement about binary tree is CORRECT?A) Every binary tree is either complete or fullB) Every complete binary tree is also a full binary treeC) Every full binary tree is also a complete binary treeD) A binary tree cannot be both complete and full

ANSWER: C

50.The run time for traversing all the nodes of a binary search tree with n nodes and printing them in an order isA) O(nlg(n))B) O(n)C) O(vn)D) O(log(n))

ANSWER: B

51. What are the applications of binary search?A) To find the lower/upper bound in an ordered sequenceB) Union of intervalsC) DebuggingD) All of the mentioned

ANSWER: D

52.Rather than build a subgraph one edge at a time …………………………. builds a tree one vertex at a time. A) kruskal’s algorithmB) prim’s algorithmC) dijkstra algorithmD) bellman ford algorithm

ANSWER: B

53. ……………… is known as a greedy algorithm, because it chooses at each step the cheapest edge to add to subgraph S. A) Kruskal’s algorithmB) Prim’s algorithmC) Dijkstra algorithmD) Bellman ford algorithm

ANSWER: A

54.The result of prim’s algorithm is a total time bound of ………………A) O(logn) B) O(m+n logn)C) O(mn) D) O(m logn)

ANSWER: B

55.The ………………… process updates the costs of all the vertices V, connected to a vertex U, if we could improve the best estimate of the shortest path to V by including (U,V) in the path to V. A) relaxationB) improvement C) shorteningD) Costing

ANSWER: A

56. …………….. turns out that one can find the shortest paths from a given source to all points in a graph in the same time. A) Kruskal’s algorithmB) Prim’s algorithmC) Dijkstra algorithmD) Bellman ford algorithm

ANSWER: C

57. ……………. keeps two sets of vertices; S, the set of vertices whose shortest paths from the source have already been determined and V-S, the remaining vertices. A) Kruskal’s algorithm

B) Prim’s algorithmC) Dijkstra algorithmD) Bellman ford algorithm

ANSWER: C

58. …………….. is a more generalized single source shortest path algorithm which can find t he shortest path in a graph with negative weighted edges. A) Kruskal’s algorithmB) Prim’s algorithmC) Dijkstra algorithmD) Bellman ford algorithm

ANSWER: D

59.A sample application of …………….. algorithm is to solve critical path problem, i.e. finding the longest path through a DAG. A) DAG application path algorithmB) DAG shortest path algorithmC) DAG critical path algorithmD) Bellman ford algorithm

ANSWER: B

60. The floyd-warshall all pairs shortest path algorithm computes the shortest paths between each pair of nodes in …………………..A) O(logn) B) O(n^2)C) O(mn) D) O(n^3)

ANSWER: D

61. In a directed graph, the …………….. can compute the transitive hull in O(n^3) A) Transitive HullB) Minimax DistanceC) Max Min DistanceD) Safest Path

ANSWER: A

62. ……………… means, for all vertices, compute its reachability. A) Transitive HullB) Minimax DistanceC) Max Min DistanceD) Safest Path

ANSWER: A

63. For a directed graph with edge lengths, the floyd warshall algorithm can compute the …………….. between each pair of nodes in O(n^3). A) Transitive HullB) Minimax DistanceC) Max Min DistanceD) Safest Path

ANSWER: B

64. Given a directed graph where the edges are labeled with survival probabilities, we can compute the …………… between the two nodes with floyd warshall. A) Transitive HullB) Minimax DistanceC) Max Min DistanceD) Safest Path

ANSWER: D

65. ………………… describe efficient algorithms for computing G^T from G, for both the adjacency list and adjacency matrix representations of G. A) Graph transpose problem B) Strongly connected components problemC) Topological sort problemD) Euler path problem

ANSWER: A

66. In …………… input is a directed acyclic graph (DAG)G=(V,E).A) Graph transpose problemB) Strongly connected components problemC) Topological sort problemD) Euler path problem

ANSWER: C

67. In …………………., a directed graph G is acylic if and only if a DFS of G yields no back edge.A) Graph transpose problem B) Strongly connected components problemC) Topological sort problemD) Euler path problem

ANSWER: C

68. …………….. is a most generalized single source shortest path algorithm to find the shortest path in a graph even with negative weights. A) Kruskal’s algorithmB) Prim’s algorithm

C) Dijkstra algorithmD) Bellman ford algorithm

ANSWER: D

69. ………………… solves the problem of finding the shortest path from a point in a graph to a destination. A) Kruskal’s algorithmB) Prim’s algorithmC) Dijkstra algorithmD) Bellman ford algorithm

ANSWER: C

70. Dijkstra algorithm is also called the …………………. shortest path problem. A) multiple sourceB) single sourceC) single destinationD) multiple destination

ANSWER: B

71. Dynamic hashing allows us to?A) Accommodate the growth of the databaseB) Accommodate the shrinkage of the databaseC) Allows modification of hash functionD) All of the mentioned

ANSWER: D

72. Dynamic hashing is also called as _________A) Extended hashingB) Extendable hashingC) Static hashingD) Movable hashing

ANSWER: B

73. Which of the following operations can be performed on an extendable hash structure?A) LookupB) InsertionC) DeletionD) All of the mentioned

ANSWER: D

74. The space overhead in dynamic hashing is ________ than that of static hashingA) MoreB) Less

C) EqualD) None of the mentioned

ANSWER: B

75. The form of dynamic hashing that avoids the additional level of indirection is called as _________A) Linear hashingB) Static hashingC) Directive hashingD) Indirective hashing

ANSWER: A

76. Which of the following is not a stable sorting algorithm?A) Insertion sortB) Selection sortC) Bubble sortD) Merge sort

ANSWER: B

77. Which of the following is a stable sorting algorithm?A) Merge sortB) Typical in-place quick sortC) Heap sortD) Selection sort

ANSWER: A

78. Which of the following is not an in-place sorting algorithm?A) Selection sortB) Heap sortC) Quick sortD) Merge sort

ANSWER: D

79. Running merge sort on an array of size n which is already sorted isA) O(n)B) O(nlogn)C) O(n2)D) None

ANSWER: B

80. The time complexity of a quick sort algorithm which makes use of median, found by an O(n) algorithm, as pivot element isA) O(n2)

B) O(nlogn)C) O(nloglogn)D) O(n)

ANSWER: B

81. Which of the following is not a noncomparison sort?

A) Counting sortB) Bucket sortC) Radix sortD) Shell sort

ANSWER: D

82. The time complexity of heap sort in worst case isA) O(logn)B) O(n)C) O(nlogn)D) O(n2)

ANSWER: C

83. If the given input array is sorted or nearly sorted, which of the following algorithm gives the best performance?A) Insertion sortB) Selection sortC) Quick sortD) Merge sort

ANSWER: A

84. Which of the following algorithm pays the least attention to the ordering of the elements in the input list?A) Insertion sortB) Selection sortC) Quick sortD) None

ANSWER: B

85. Consider the situation in which assignment operation is very costly. Which of the following sorting algorithm should be performed so that the number of assignment operations is minimized in general?A) Insertion sortB) Selection sortC) Heap sortD) None

ANSWER: B

86. Time complexity of bubble sort in best case isA) (n)B) (nlogn)C) (n2) D) (n(logn)2)

ANSWER: A

87. Given a number of elements in the range [0….n3]. which of the following sorting algorithms can sort them in O(n) time?A) Counting sortB) Bucket sortC) Radix sortD) Quick sort

ANSWER: C

88. Which of the following algorithms has lowest worst case time complexity?A) Insertion sortB Selection sortC) Quick sortD) Heap sort

ANSWER: D

89. Which of the following sorting algorithms is/are stableA) Counting sortB) Bucket sortC) Radix sortD) All of the above

ANSWER: D

90. Counting sort performs …………. Numbers of comparisons between input elements.A) 0B) nC) nlognD) n2

ANSWER: A

91. The running time of radix sort on an array of n integers in the range [0……..n5 -1] when using base 10 representation isA) (n)B) (nlogn)C) (n2)

D) none

ANSWER: B

92. The running time of radix sort on an array of n integers in the range [0……..n5 -1] when using base n representation is

A) (n)B) (nlogn)C) (n2)D) None

ANSWER: A

93. Which of the following sorting algorithm is in-placeA) Counting sortB) Radix sortC) Bucket sortD) None

ANSWER: B

94. The radix sort does not work correctly if each individual digit is sorted usingA) Quick SortB) Counting sortC) Selection sortD) Bubble sort

ANSWER: C

95. Which of the following sorting algorithm has the running time that is least dependant on the initial ordering of the input?A) Insertion sortB) Quick sortC) Merge sortD) Selection sort

ANSWER: D

96. Time complexity to sort elements of binary search tree isA) O(n)B) O(nlogn)C) O(n2)D) O(n2logn)

ANSWER: A

97. The lower bound on the number of comparisons performed by comparison-based sorting algorithm is A) O(1)B) O(n)C) O(nlogn)D) O(n2)

ANSWER: C

98. Which of the following algorithm(s) can be used to sort n integers in range [1…..n3] in O(n) time?A) Heap sortB) Quick sortC) Merge sortD) Radix sort

ANSWER: D

99. Which of the following algorithm design technique is used in the quick sort algorithm?A) Dynamic programmingB) BacktrackingC) Divide-and-conquerD) Greedy method

ANSWER: C

100. Merge sort usesA) Divide-and-conquerB) BacktrackingC) Heuristic approachD) Greedy approach

ANSWER: A

101.Which level of RAID refers to disk mirroring with block striping?A) RAID level 1B) RAID level 2C) RAID level 0D) RAID level 3

ANSWER: A

102. A unit of storage that can store one or more records in a hash file organization is denoted asA) BucketsB) Disk pagesC) BlocksD) Nodes

ANSWER: A

103. The file organization which allows us to read records that would satisfy the join condition by using one block read isA) Heap file organizationB) Sequential file organizationC) Clustering file organizationD) Hash file organization

ANSWER: C

104. What are the correct features of a distributed database?A) Is always connected to the internetB) Always requires more than three machinesC) Users see the data in one global schema.D) Have to specify the physical location of the data when an update is done

ANSWER: C

105. Each tablespace in an Oracle database consists of one or more files calledA) FilesB) name spaceC) datafilesD) PFILE

ANSWER: C

106. The management information system (MIS) structure with one main computer system is called aA) Hierarchical MIS structureB) Distributed MIS structureC) Centralized MIS structureD) Decentralized MIS structure

ANSWER: C

107. A top-to-bottom relationship among the items in a database is established by aa) Hierarchical schemab) Network schemac) Relational schemad) All of the mentioned

ANSWER: A

108. Choose the RDBMS which supports full fledged client server application developmentA) dBase VB) Oracle 7.1C) FoxPro 2.1D) Ingress

ANSWER: B

109. One approach to standardization storing of data?A) MISB) Structured programmingC) CODASYL specificationD) None of the mentioned

ANSWER: C

110. The highest level in the hierarchy of data organization is calledA) Data bankB) Data baseC) Data fileD) Data record

ANSWER: B

111. If a piece of data is stored in two places in the database, thenA) Storage space is wastedB) Changing the data in one spot will cause data inconsistencyC) In can be more easily accessedD) Storage space is wasted & Changing the data in one spot will cause data inconsistency

ANSWER: D

112. An audit trail ___________A) Is used to make backup copiesB) Is the recorded history of operations performed on a fileC) Can be used to restore lost informationD) None of the mentioned

ANSWER: B

113. Large collection of files are called ____________A) FieldsB) RecordsC) DatabaseD) Sectors

ANSWER: C

114. Which of the following hardware component is the most important to the operation of a database management system?A) High resolution video displayB) PrinterC) High speed, large capacity diskD) Mouse

ANSWER: C

115. Which of the following is not true of the traditional approach to information processingA) There is common sharing of data among the various applicationsB) It is file orientedC) Programs are dependent on the fileD) It is inflexible

ANSWER: A

116. Which of these is not a feature of Hierarchical model?A) Organizes the data in tree-like structureB) Parent node can have any number of child nodesC) Root node does not have any parentD) Child node can have any number of parent nodes

ANSWER: D

117. Which of these data models is an extension of the relational data model?A) Object-oriented data modelB) Object-relational data modelC) Semi structured data modelD) None of the mentioned

ANSWER: B

118. The information about data in a database is called _______A) MetadataB) Hyper dataC) Tera dataD) None of the mentioned

ANSWER: A

119. A data dictionary is a special file that contains?A) The names of all fields in all filesB) The data types of all fields in all filesC) The widths of all fields in all filesD) All of the mentioned

ANSWER: D

120. The DBMS acts as an interface between what two components of an enterprise-class database system?A) Database application and the databaseB) Data and the databaseC) The user and the database application

D) Database application and SQL

ANSWER: A

121. A relational database system needs to maintain data about the relations, such as the schema of the relations. This is calledA) MetadataB) CatalogC) LogD) Dictionary

ANSWER: A

122. Relational schemas and other metadata about relations are stored in a structure called the ____________A) MetadataB) CatalogD) Data Dictionary

ANSWER: D

123. ___________ is the collection of memory structures and Oracle background processes that operates against an Oracle database.A) DatabaseB) InstanceC) TablespaceD) Segment

ANSWER: B

124. A ________ is a logical grouping of database objects, usually to facilitate security, performance, or the availability of database objects such as tables and indexes.A) TablespaceB) SegmentsC) ExtentsD) Blocks

ANSWER: A

125. A tablespace is further broken down into ________A) TablespaceB) SegmentsC) ExtentsD) Blocks

ANSWER: B