Anda di halaman 1dari 9

# MCQs DATASTRUCTURE

## Data Structure Multiple Choice Questions And Answers - Set 2

Tags: Data Structure

## Data Structure Objective Type Questions And Answers

Tags: Data Structure

## Data structure multiple choice questions and answers with explanation.

1) The average search time of hashing with linear probing will be less if
is far less than one
equals one
is far greater than one
None of above
Explanation: No Explanation
2) The complexity of binary search algorithm is ?
n
nlogn
logn
n2
Explanation:N/A
3) The postfix equivalent of the prefix * + ab - cd is ?
ab + cd - *
abcd + - *
ab + cd * ab + - cd *
Explanation: No Explanation
4)The linked list implementation of sparse matrices is superior to the
generalized dope vector method because it is?
Conceptually easier
Completely dynamic
Efficient in accessing an entry
Efficient if the sparse matrix is a band matrix
A and B

## 1) If the sequence of operations - push(1), push(2), pop, push(1),

push(2), pop, pop, pop, push(2), pop are performed on a stack, the
sequence of popped out values are ?
2, 2, 1, 1, 2
2, 2, 1, 2, 2
2, 1, 2, 2, 1
2, 1, 2, 2, 2
Explanation: The elements are popped from the top of the stack.
2) Queue can be used to implement ?
quick sort
recursion
depth first search
Explanation: A simple version of an LSD radix sort can be achieved
using queues as buckets.
3) A machine took 200 sec to sort 200 names, using bubble sort. In 800
sec, it can approximately sort?
400 names
800 names
750 names
800 names
Explanation: For sorting 200 names bubble sort makes 200 x 199/2 =
19900 comparisons. The time needed for 1 comparison is 200 sec. In
800 sec it can make 80,000 comparisons. We have to fine n, such that
n(n - 1)/2 = 80,000. From this n is approximately 400.

MCQs DATASTRUCTURE
eatvc swat #+92-3329209693

## 4) A machine needs a minimum of 100 sec to sort 1000 names by quick

sort.The minimum time needed to sort 100 names will be approximately
?
50.2 sec
6.7 sec
72.7 sec
11.2 sec
Explanation: In the best case quick sort algorithm makes n log(n)
comparisons. so 1000 x log (1000) = 9000 comparisons, which takes
100 sec. To sort 100 names a minimum of 100 log(100) = 600
comparisons are needed. This takes 100 x 600/9000 = 6.7 sec.
5) The number of binary trees with 3 nodes which when traversed in
post order gives the sequence A,B,C is ?
3
9
7
5
Explanation: Five trees are

6) The average search time of hashing with linear probing will be less if
is far less than one
equals one
is far greater than one
none of above
Explanation:Load factor is the ratio number of records that are currently
present and the total number of records that can be present. If the load

## By: Kalim Ullah Khan

Explanation: N/A
5) Sparse matrix have ?
many zero entries
many non-zero entries
higher dimension
none of above
Explanation: A sparse matrix is a matrix populated primarily with zeros
6) Which of the following algorithm solves the all pair shortest path
problem ?
Dijkstra's algorithm
Floyd's algorithm
Prim's algorithm
Warshall's algorithm
Explanation: The FloydWarshall algorithm (also known as Floyd's
algorithm, RoyWarshall algorithm, RoyFloyd algorithm, or the WFI
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
rearranging the library books in a shelf in proper order, at the end of
each day. The ideal choice will be ?
Bubble sort
Insertion sort
Selection sort
Heap sort
Explanation:N/A

MCQs DATASTRUCTURE
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.
7) A binary tree that has n leaf nodes. The number of nodes of degree
2 in this tree is ?
log2n
n-1
n
2n
Explanation: It can be proved by induction that a binary tree with n leaf
nodes will have total of 2n - 1 nodes. So number of non-leaf nodes is
(2n - 1)-n=n-1
8) The principal of locality justifies the use of ?
Interrupts
DMA
Polling
Cache memory
Explanation:In principal of phenomenon the same value or same
memory location is being used frequently.
9) Sparse matrices have ?
many zero entries
many non- zero entries
higher dimension
none of above
Answer = A Explanation: A sparse matrix is a matrix populated primarily
with zeros
10) The postfix expression for * + a b - c d is?
ab + cd - *
ab cd + - *
ab + cd * ab + - cd *

## By: Kalim Ullah Khan

8) The way a card game player arranges his cards as he picks them up
one by one, is an example of ?
bubble sort
selection sort
insertion sort
merge sort
Explanation: He scans throught the rest of the cards and pick the one
with least value and places it next to the point till which he has already
sorted the cards
9) The average successful search time for sequential search on 'n'
items is ?
n/2
(n - 1)/2
(n + 2)/2
log(n) + 1
Explanation:N/A
10) Linked lists are suitable for which of the following problems ?
Insertion sort
Binary search
Polynomial manipulation
Explanation: Through Linked list binary search can be performed
efficiently.
- See more at: http://edugrip.blogspot.com/2012/08/datastructure-objective-type-questions.html#sthash.zJy1Jo5v.dpuf

MCQs DATASTRUCTURE
eatvc swat #+92-3329209693

Multiple Choice Questions On Data Structure | UGC NET
Exam 2012 Sample
Tags: Data Structure
1)What is Data Structure ?
Way to organize data
Accessing of data elements in specified manner
Organization of mathematical and logical concepts
All of Above
Explanation:A Data Structure may be organized in different ways :
The logical or mathematical model of a particular organization of
data is called Data Structure.
2) Which operation is not possible on Data Structure ?
Traversing
Insertion
Deletion
Explanation:Possible operations on the Data Structure are
Traversing, Insertion, Searching and Deletion.
3) The memory address of the first element is called ?
Explanation:The memory address of the first element is often
called base address in Data Structure.
0
-1

## C Language MCQ - Online Programming Quiz

Tags: C language
1) A self contained block of statements that perform a coherent
task of some kind is called a?
Monitor
Function
Program
Structure
2) Recursion is sometimes called ?
Circular definition
Complex definition
Procedure
Union
3) The directive that can be used to test whether an expression
evaluates to a nonzero value or not is ?
#if
#elif
#endif
#exit
4) The number of arguments supplied from the command line, by
conversion is known as ?
arg c
arg v
#define
#include
5) The expression X=4+2%-8 evaluates ?

MCQs DATASTRUCTURE
eatvc swat #+92-3329209693

1
None of Above
Explanation: No explanation for this question.
5) Two dimensional arrays are also called ?
Matrix Array
Table Array
Both a and b
None of the Above
Explanation:Two dimensional arrays are called as matrix array and
table arrays because they contains rows and columns.
6) The situation in linked list START=NULL is called ?
Overflow
Underflow
Both of above
None of Above
Explanation:It is the situation when we are trying to delete an item
7) Length of the linear array can be found by using the formula ?
UB - LB + 1
LB + UB
LB - UB
LB - UB + 1
Explanation:The length of linear array can be found by using UB LB + 1 Where UB is upper Bound, LB is Lower Bound of the array.
8) The restriction while using the binary search is ?
List should be small in number
List should be large in number

## By: Kalim Ullah Khan

-6
6
4
None
6) Determine which of the following is valid character constant ?
'//'
'\0'
'xyz'
'\052'
7) Given the statement , maruti.engine.bolts=25 . Which of the
following is true?
Structure bolts is nested within structure engine
Structure engine is nested within structure maruti
Structure maruti is nested within structure engine
Structure maruti nested within structure bolts
8) To access a structure element using a pointer, ......... operator is
used?
dot ( . )
pointer ( & )
pointer ( * )
arrow ( -> )
9) The ........ operator is a technique to forcefully convert one data
type to the other ?
Cast
Conversion
Type
Uniary

MCQs DATASTRUCTURE
eatvc swat #+92-3329209693

## List should be sorted

No restriction
Explanation: Binary search can be applied to a list only if the list
is either in ascending or descending order.
9) The terms PUSH and POP are related to ?
Arrays
Stacks
None
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
Explanation:Traversing means visiting or processing each element
exactly once.
- See more at: http://edugrip.blogspot.com/2012/04/multiplechoice-questions-on-data.html#sthash.KzdR94tQ.dpuf

10) Which of the following numerical value is invalid constant ?
assignment operator
relational operator
logical operator
bitwise shift operator

## 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
relationship between data items allows designing of efficient algorithms for the
manipulation of data.

## Polish and Reverse Polish notations.

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

MCQs DATASTRUCTURE
eatvc swat #+92-3329209693

## By: Kalim Ullah Khan

1.

Compiler Design,

2.

Operating System,

3.

4.

## Statistical analysis package,

5.

Numerical Analysis,

## Sorting is not possible in Deletion. Using insertion we can perform insertion

sort, using selection we can perform selection sort, using exchange we can perform
the bubble sort (and other similar sorting methods). But no sorting method can be
done just using deletion.

6.

Graphics,

## 10. What are the methods available in storing sequential files ?

7.

Artificial Intelligence,

1.

Straight merging,

8.

Simulation

2.

Natural merging,

3.

Polyphase sort,

4.

## Distribution of Initial runs.

3. What are the major data structures used in the following areas : RDBMS,
Network data model and Hierarchical data model.
1.

2.

Postfix Notation: AB + C * DE - FG + ^ -

## 9. Sorting is not possible by using which of the following methods?

(Insertion, Selection, Exchange, Deletion)

## RDBMS = Array (i.e. Array of structures)

11. List out few of the Application of tree data-structure?

2.
3.

1.

2.

3.

Syntax analysis.

## 4. If you are using C language to implement the heterogeneous linked list,

what pointer type will you use?
The heterogeneous linked list contains different data types in its nodes and we
need a link, pointer to connect them. It is not possible to use ordinary pointers for
this. So we go for void pointer. Void pointer is capable of storing pointer to any type
as it is a generic pointer type.
5. Minimum number of queues needed to implement the priority queue?
Two. One queue is used for actual storing of data and another for storing priorities.

12. List out few of the applications that make use of Multilinked
Structures?
1.

Sparse matrix,

2.

Index generation.

MCQs DATASTRUCTURE
eatvc swat #+92-3329209693

## 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.

## 13. In tree construction which is the suitable efficient data structure?

19. In RDBMS, what is the efficient data structure used in the internal
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?
Backtracking.
15. In an AVL tree, at what condition the balancing is to be done?
If the 'pivotal value' (or the 'Height factor') is greater than 1 or less than -1.
16. What is the bucket size, when the overlapping and collision occur at
same time?
One. If there is only one entry possible in the bucket, when the collision occurs,
there is no way to accommodate the colliding value. This results in the overlapping
of values.
17. Classify the Hashing Functions based on the various methods by which
the key value is found.

## 20. What is a spanning Tree?

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
that the total edge weight between nodes is minimized.
21. Does the minimum spanning tree of a graph give the shortest distance
between any 2 specified nodes?
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
involved in the minimum-spanning tree is minimum.
22. Which is the simplest file structure? (Sequential, Indexed, Random)
Sequential is the simplest file structure.
23. Whether Linked List is linear or Non-linear data structure?

1.

Direct method,
According to Access strategies Linked list is a linear one.

MCQs DATASTRUCTURE
eatvc swat #+92-3329209693
2.

Subtraction method,

3.

Modulo-Division method,

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.

block.

2.