You are on page 1of 9

MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

Data Structure Multiple Choice Questions And Answers - Set 2 Data Structure Objective Type Questions And Answers
Tags: Data Structure Tags: Data Structure

Data Structure Multiple choice and objective type questions. Data structure multiple choice questions and answers with explanation.
1) The average search time of hashing with linear probing will be less if
1) If the sequence of operations - push(1), push(2), pop, push(1), the load factor ?
push(2), pop, pop, pop, push(2), pop are performed on a stack, the is far less than one
sequence of popped out values are ? equals one
2, 2, 1, 1, 2 is far greater than one
2, 2, 1, 2, 2 None of above
2, 1, 2, 2, 1 Show/Hide Answer
2, 1, 2, 2, 2 Answer = A
Show/Hide Answer Explanation: No Explanation
Answer = A 2) The complexity of binary search algorithm is ?
Explanation: The elements are popped from the top of the stack. n
2) Queue can be used to implement ? nlogn
radix sort logn
quick sort n2
recursion Show/Hide Answer
depth first search Answer = D
Show/Hide Answer Explanation:N/A
Answer = A 3) The postfix equivalent of the prefix * + ab - cd is ?
Explanation: A simple version of an LSD radix sort can be achieved ab + cd - *
using queues as buckets. abcd + - *
3) A machine took 200 sec to sort 200 names, using bubble sort. In 800 ab + cd * -
sec, it can approximately sort? ab + - cd *
400 names Show/Hide Answer
800 names Answer = A
750 names Explanation: No Explanation
800 names 4)The linked list implementation of sparse matrices is superior to the
Show/Hide Answer generalized dope vector method because it is?
Answer = A Conceptually easier
Explanation: For sorting 200 names bubble sort makes 200 x 199/2 = Completely dynamic
19900 comparisons. The time needed for 1 comparison is 200 sec. In Efficient in accessing an entry
800 sec it can make 80,000 comparisons. We have to fine n, such that Efficient if the sparse matrix is a band matrix
n(n - 1)/2 = 80,000. From this n is approximately 400. A and B
MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

4) A machine needs a minimum of 100 sec to sort 1000 names by quick Show/Hide Answer
sort.The minimum time needed to sort 100 names will be approximately Answer = E
? Explanation: N/A
50.2 sec 5) Sparse matrix have ?
6.7 sec many zero entries
72.7 sec many non-zero entries
11.2 sec higher dimension
Show/Hide Answer none of above
Answer = B Show/Hide Answer
Explanation: In the best case quick sort algorithm makes n log(n) Answer = A
comparisons. so 1000 x log (1000) = 9000 comparisons, which takes Explanation: A sparse matrix is a matrix populated primarily with zeros
100 sec. To sort 100 names a minimum of 100 log(100) = 600 6) Which of the following algorithm solves the all pair shortest path
comparisons are needed. This takes 100 x 600/9000 = 6.7 sec. problem ?
5) The number of binary trees with 3 nodes which when traversed in Dijkstra's algorithm
post order gives the sequence A,B,C is ? Floyd's algorithm
3 Prim's algorithm
9 Warshall's algorithm
7 Show/Hide Answer
5 Answer = B
Show/Hide Answer Explanation: The FloydWarshall algorithm (also known as Floyd's
Answer = D algorithm, RoyWarshall algorithm, RoyFloyd algorithm, or the WFI
Explanation: Five trees are algorithm) is a graph analysis algorithm for finding shortest paths in a
weighted graph (with positive or negative edge weights) and also for
finding transitive closure of a relation R.

7) As part of maintenance work, you are entrusted with the work of


6) The average search time of hashing with linear probing will be less if rearranging the library books in a shelf in proper order, at the end of
the load factor ? each day. The ideal choice will be ?
is far less than one Bubble sort
equals one Insertion sort
is far greater than one Selection sort
none of above Heap sort
Show/Hide Answer Show/Hide Answer
Answer = A Answer = B
Explanation:Load factor is the ratio number of records that are currently Explanation:N/A
present and the total number of records that can be present. If the load
MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

factor is less, free space will be more. This means probability of


collision is less. So the search time will be less. 8) The way a card game player arranges his cards as he picks them up
7) A binary tree that has n leaf nodes. The number of nodes of degree one by one, is an example of ?
2 in this tree is ? bubble sort
log2n selection sort
n-1 insertion sort
n merge sort
2n Show/Hide Answer
Show/Hide Answer Answer = C
Answer = B Explanation: He scans throught the rest of the cards and pick the one
Explanation: It can be proved by induction that a binary tree with n leaf with least value and places it next to the point till which he has already
nodes will have total of 2n - 1 nodes. So number of non-leaf nodes is sorted the cards
(2n - 1)-n=n-1 9) The average successful search time for sequential search on 'n'
8) The principal of locality justifies the use of ? items is ?
Interrupts n/2
DMA (n - 1)/2
Polling (n + 2)/2
Cache memory log(n) + 1
Show/Hide Answer Show/Hide Answer
Answer = D Answer = C
Explanation:In principal of phenomenon the same value or same Explanation:N/A
memory location is being used frequently. 10) Linked lists are suitable for which of the following problems ?
9) Sparse matrices have ? Insertion sort
many zero entries Binary search
many non- zero entries Radix sort
higher dimension Polynomial manipulation
none of above Show/Hide Answer
Show/Hide Answer Answer = B
Answer = A Explanation: A sparse matrix is a matrix populated primarily Explanation: Through Linked list binary search can be performed
with zeros efficiently.
10) The postfix expression for * + a b - c d is? - See more at: http://edugrip.blogspot.com/2012/08/data-structure-
ab + cd - * objective-type-questions.html#sthash.zJy1Jo5v.dpuf
ab cd + - *
ab + cd * -
ab + - cd *
Show/Hide Answer
MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

Answer = A
Multiple Choice Questions On Data Structure | UGC NET C Language MCQ - Online Programming Quiz
Exam 2012 Sample Tags: C language
Tags: Data Structure
1) A self contained block of statements that perform a coherent
1)What is Data Structure ? task of some kind is called a?
Way to organize data Monitor
Accessing of data elements in specified manner Function
Organization of mathematical and logical concepts Program
All of Above Structure
Show/Hide Answer Show/Hide Answer
Answer = D Answer = B
Explanation:A Data Structure may be organized in different ways : 2) Recursion is sometimes called ?
The logical or mathematical model of a particular organization of Circular definition
data is called Data Structure. Complex definition
2) Which operation is not possible on Data Structure ? Procedure
Traversing Union
Insertion Show/Hide Answer
Reading Answer =A
Deletion 3) The directive that can be used to test whether an expression
Show/Hide Answer evaluates to a nonzero value or not is ?
Answer = C #if
Explanation:Possible operations on the Data Structure are #elif
Traversing, Insertion, Searching and Deletion. #endif
3) The memory address of the first element is called ? #exit
Floor Address Show/Hide Answer
Foundation Address Answer = A
First Address 4) The number of arguments supplied from the command line, by
Base Address conversion is known as ?
Show/Hide Answer arg c
Answer = D arg v
Explanation:The memory address of the first element is often #define
called base address in Data Structure. #include
4) The value of first linked list address is ? Show/Hide Answer
0 Answer = A
-1 5) The expression X=4+2%-8 evaluates ?
MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

1 -6
None of Above 6
Show/Hide Answer 4
Answer = 0 None
Explanation: No explanation for this question. Show/Hide Answer
5) Two dimensional arrays are also called ? Answer =B
Matrix Array 6) Determine which of the following is valid character constant ?
Table Array '//'
Both a and b '\0'
None of the Above 'xyz'
Show/Hide Answer '\052'
Answer = C Show/Hide Answer
Explanation:Two dimensional arrays are called as matrix array and Answer = A
table arrays because they contains rows and columns. 7) Given the statement , maruti.engine.bolts=25 . Which of the
following is true?
6) The situation in linked list START=NULL is called ? Structure bolts is nested within structure engine
Overflow Structure engine is nested within structure maruti
Underflow Structure maruti is nested within structure engine
Both of above Structure maruti nested within structure bolts
None of Above Show/Hide Answer
Show/Hide Answer Answer =B
Answer = B 8) To access a structure element using a pointer, ......... operator is
Explanation:It is the situation when we are trying to delete an item used?
from the empty linked list. dot ( . )
7) Length of the linear array can be found by using the formula ? pointer ( & )
UB - LB + 1 pointer ( * )
LB + UB arrow ( -> )
LB - UB Show/Hide Answer
LB - UB + 1 Answer =D
Show/Hide Answer 9) The ........ operator is a technique to forcefully convert one data
Answer = A type to the other ?
Explanation:The length of linear array can be found by using UB - Cast
LB + 1 Where UB is upper Bound, LB is Lower Bound of the array. Conversion
8) The restriction while using the binary search is ? Type
List should be small in number Uniary
List should be large in number Show/Hide Answer
MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

List should be sorted Answer = A


No restriction 10) Which of the following numerical value is invalid constant ?
Show/Hide Answer assignment operator
Answer = C relational operator
Explanation: Binary search can be applied to a list only if the list logical operator
is either in ascending or descending order. bitwise shift operator
9) The terms PUSH and POP are related to ? Show/Hide Answer
Arrays Answer = D
Stacks
Linked List
None
Show/Hide Answer
Answer = B
Explanation:PUSH is used for inserting an element into the stack
and POP is used for deleting an elements from the stack.
10) The operation of processing element is called ?
Traversing
Inserting
Deleting
Searching
Show/Hide Answer
Answer = A
Explanation:Traversing means visiting or processing each
element exactly once.
- See more at: http://edugrip.blogspot.com/2012/04/multiple-
choice-questions-on-data.html#sthash.KzdR94tQ.dpuf
1. What is data structure? 7. What are the notations used in Evaluation of Arithmetic Expressions
using prefix and postfix forms?
A data structure is a way of organizing data that considers not only the items
stored, but also their relationship to each other. Advance knowledge about the Polish and Reverse Polish notations.
relationship between data items allows designing of efficient algorithms for the
manipulation of data. 8. Convert the expression ((A + B) * C - (D - E) ^ (F + G)) to equivalent
Prefix and Postfix notations.
2. List out the areas in which data structures are applied extensively?
1. Prefix Notation: - * +ABC ^ - DE + FG
1. Compiler Design, 2. Postfix Notation: AB + C * DE - FG + ^ -
2. Operating System,
MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

3. Database Management System, 9. Sorting is not possible by using which of the following methods?
4. Statistical analysis package, (Insertion, Selection, Exchange, Deletion)
5. Numerical Analysis,
6. Graphics, Sorting is not possible in Deletion. Using insertion we can perform insertion
7. Artificial Intelligence, sort, using selection we can perform selection sort, using exchange we can perform
8. Simulation the bubble sort (and other similar sorting methods). But no sorting method can be
done just using deletion.
3. What are the major data structures used in the following areas : RDBMS,
Network data model and Hierarchical data model. 10. What are the methods available in storing sequential files ?

1. RDBMS = Array (i.e. Array of structures) 1. Straight merging,


2. Network data model = Graph 2. Natural merging,
3. Hierarchical data model = Trees 3. Polyphase sort,
4. Distribution of Initial runs.
4. If you are using C language to implement the heterogeneous linked list,
what pointer type will you use? 11. List out few of the Application of tree data-structure?

The heterogeneous linked list contains different data types in its nodes and we 1. The manipulation of Arithmetic expression,
need a link, pointer to connect them. It is not possible to use ordinary pointers for 2. Symbol Table construction,
this. So we go for void pointer. Void pointer is capable of storing pointer to any 3. Syntax analysis.
type as it is a generic pointer type.
12. List out few of the applications that make use of Multilinked
5. Minimum number of queues needed to implement the priority queue? Structures?

Two. One queue is used for actual storing of data and another for storing priorities. 1. Sparse matrix,
2. Index generation.
6. What is the data structures used to perform recursion?

Stack. Because of its LIFO (Last In First Out) property it remembers its 'caller' so
knows whom to return when the function has to return. Recursion makes use of
system stack for storing the return addresses of the function calls.

Every recursive function has its equivalent iterative (non-recursive) function. Even
when such equivalent iterative procedures are written, explicit stack is to be used.
MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

13. In tree construction which is the suitable efficient data structure? 19. In RDBMS, what is the efficient data structure used in the internal
(Array, Linked list, Stack, Queue) storage representation?

Linked list is the suitable efficient data structure. B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes
searching easier. This corresponds to the records that shall be stored in leaf nodes.
14. What is the type of the algorithm used in solving the 8 Queens
problem? 20. What is a spanning Tree?

Backtracking. A spanning tree is a tree associated with a network. All the nodes of the graph
appear on the tree once. A minimum spanning tree is a spanning tree organized so
15. In an AVL tree, at what condition the balancing is to be done? that the total edge weight between nodes is minimized.

If the 'pivotal value' (or the 'Height factor') is greater than 1 or less than -1. 21. Does the minimum spanning tree of a graph give the shortest distance
between any 2 specified nodes?
16. What is the bucket size, when the overlapping and collision occur at
same time? No. The Minimal spanning tree assures that the total weight of the tree is kept at
its minimum. But it doesn't mean that the distance between any two nodes
One. If there is only one entry possible in the bucket, when the collision occurs, involved in the minimum-spanning tree is minimum.
there is no way to accommodate the colliding value. This results in the overlapping
of values. 22. Which is the simplest file structure? (Sequential, Indexed, Random)

17. Classify the Hashing Functions based on the various methods by which Sequential is the simplest file structure.
the key value is found.
23. Whether Linked List is linear or Non-linear data structure?
1. Direct method,
2. Subtraction method, According to Access strategies Linked list is a linear one.
3. Modulo-Division method, According to Storage Linked List is a Non-linear one.
4. Digit-Extraction method,
5. Mid-Square method,
6. Folding method,
7. Pseudo-random method.

18. What are the types of Collision Resolution Techniques and the methods
used in each of the type?

1. Open addressing (closed hashing), The methods used include: Overflow


block.
MCQs DATASTRUCTURE By: Kalim Ullah Khan eatvc swat #+92-3329209693

2. Closed addressing (open hashing), The methods used include: Linked


list, Binary tree.

You might also like