0% found this document useful (0 votes)
12 views

Data Structure by Blogspot

Data structure notes by blogspot. This is done by compiling the data from blog spot

Uploaded by

itexecutive4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Data Structure by Blogspot

Data structure notes by blogspot. This is done by compiling the data from blog spot

Uploaded by

itexecutive4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Data structures & Algorithms - Collection on http://www.cs-mcqs.blogspot.

com
Multiple Choice Questions
5. The Worst case occur in linear search algorithm
(MCQs) - Objective when
a. Item is somewhere in the middle of the array
b. Item is not in the array at all
c. Item is the last element in the array
d. Item is the last element in the array or is not there at
all

Collection on http://www.cs-mcqs.blogspot.com

6. The Average case occur in linear search algorithm


Set - 1 a. When Item is somewhere in the middle of the array
b. When Item is not in the array at all
c. When Item is the last element in the array
d. When Item is the last element in the array or is not
there at all

Collection on http://www.cs-mcqs.blogspot.com
1. Two main measures for the efficiency of an algorithm
are 7. The complexity of the average case of an algorithm
a. Processor and memory is
b. Complexity and capacity a. Much more complicated to analyze than that of worst
c. Time and space case
d. Data and space b. Much more simpler to analyze than that of worst case
c. Sometimes more complicated and some other times
Collection on http://www.cs-mcqs.blogspot.com simpler than that of worst case
d. None or above

Collection on http://www.cs-mcqs.blogspot.com
2. The time factor when determining the efficiency of
algorithm is measured by
a. Counting microseconds 8. The complexity of linear search algorithm is
b. Counting the number of key operations a. O(n)
c. Counting the number of statements b. O(log n)
d. Counting the kilobytes of algorithm c. O(n2)
d. O(n log n)
Collection on http://www.cs-mcqs.blogspot.com
Collection on http://www.cs-mcqs.blogspot.com
3. The space factor when determining the efficiency of
algorithm is measured by 9. The complexity of Binary search algorithm is
a. Counting the maximum memory needed by the a. O(n)
algorithm b. O(log )
b. Counting the minimum memory needed by the c. O(n2)
algorithm d. O(n log n)
c. Counting the average memory needed by the
algorithm Collection on http://www.cs-mcqs.blogspot.com
d. Counting the maximum disk space needed by the
algorithm 10. The complexity of Bubble sort algorithm is
a. O(n)
Collection on http://www.cs-mcqs.blogspot.com b. O(log n)
c. O(n2)
4. Which of the following case does not exist in d. O(n log n)
complexity theory
a. Best case Collection on http://www.cs-mcqs.blogspot.com
b. Worst case
c. Average case 11. The complexity of merge sort algorithm is
d. Null case a. O(n)
b. O(log n)
c. O(n2) a. for relatively permanent collections of data
d. O(n log n) b. for the size of the structure and the data in the
structure are constantly changing
Collection on http://www.cs-mcqs.blogspot.com c. for both of above situation
d. for none of above situation
12. The indirect change of the values of a variable in
one module by another module is called Collection on http://www.cs-mcqs.blogspot.com
a. internal change
b. inter-module change 19. Each array declaration need not give, implicitly or
c. side effect explicitly, the information about
d. side-module update a. the name of array
b. the data type of array
Collection on http://www.cs-mcqs.blogspot.com c. the first data from the set to be stored
d. the index set of the array
13. Which of the following data structure is not linear
data structure? Collection on http://www.cs-mcqs.blogspot.com
a. Arrays
b. Linked lists 20. The elements of an array are stored successively in
c. Both of above memory cells because
d. None of above a. by this way computer can keep track only the
address of the first element and the addresses of other
Collection on http://www.cs-mcqs.blogspot.com elements can be calculated
b. the architecture of computer memory does not allow
14. Which of the following data structure is linear data arrays to store other than serially
structure? c. both of above
a. Trees d. none of above
b. Graphs
c. Arrays Collection on http://www.cs-mcqs.blogspot.com
d. None of above

Collection on http://www.cs-mcqs.blogspot.com

15. The operation of processing each element in the list


is known as
a. Sorting
Answers
b. Merging
c. Inserting
d. Traversal 1. Two main measures for the efficiency of an algorithm
are
Collection on http://www.cs-mcqs.blogspot.com c. Time and space
2. The time factor when determining the efficiency of
16. Finding the location of the element with a given algorithm is measured by
value is: b. Counting the number of key operations
a. Traversal 3. The space factor when determining the efficiency of
b. Search algorithm is measured by
c. Sort a. Counting the maximum memory needed by the
d. None of above algorithm
4. Which of the following case does not exist in
Collection on http://www.cs-mcqs.blogspot.com complexity theory
d. Null case
5. The Worst case occur in linear search algorithm
17. Arrays are best data structures
when
a. for relatively permanent collections of data
d. Item is the last element in the array or is not there at
b. for the size of the structure and the data in the
all
structure are constantly changing
6. The Average case occur in linear search algorithm
c. for both of above situation
a. When Item is somewhere in the middle of the array
d. for none of above situation
7. The complexity of the average case of an algorithm is
a. Much more complicated to analyze than that of worst
Collection on http://www.cs-mcqs.blogspot.com
case
8. The complexity of linear search algorithm is
18. Linked lists are best suited a. O(n)
9. The complexity of Binary search algorithm is c. both of above
b. O(log n) d. none of above
10. The complexity of Bubble sort algorithm is
c. O(n2) 4. Which of the following is not the required condition for
11. The complexity of merge sort algorithm is binary search algorithm?
d. O(n log n) a. The list must be sorted
12. The indirect change of the values of a variable in b. there should be the direct access to the middle
one module by another module is called element in any sublist
c. side effect c. There must be mechanism to delete and/or
13. Which of the following data structure is not linear insert elements in list
data structure? d. none of above
d. None of above
14. Which of the following data structure is linear data 5. Which of the following is not a limitation of binary
structure? search algorithm?
c. Arrays a. must use a sorted array
15. The operation of processing each element in the list b. requirement of sorted array is expensive when a lot
is known as of insertion and deletions are needed
d. Traversal c. there must be a mechanism to access middle
16. Finding the location of the element with a given element directly
value is: d. binary search algorithm is not efficient when the data
b. Search elements are more than 1000.
17. Arrays are best data structures
a. for relatively permanent collections of data
6. Two dimensional arrays are also called
18. Linked lists are best suited
a. tables arrays
b. for the size of the structure and the data in
b. matrix arrays
the structure are constantly changing
c. both of above
19. Each array declaration need not give, implicitly or
d. none of above
explicitly, the information about
c. the first data from the set to be stored
7. A variable P is called pointer if
20. The elements of an array are stored successively in a. P contains the address of an element in DATA.
memory cells because b. P points to the address of first element in DATA
a. by this way computer can keep track only the c. P can store only memory addresses
address of the first element and the addresses of other d. P contain the DATA and the address of DATA
elements can be calculated
8. Which of the following data structure can't store the
Set - 2 non-homogeneous data elements?
a. Arrays
b. Records
1. The memory address of the first element of an array c. Pointers
is called d. None
a. floor address
b. foundation address
9. Which of the following data structure store the
c. first address
homogeneous data elements?
d. base address
a. Arrays
b. Records
2. The memory address of fifth element of an array can c. Pointers
be calculated by the formula d. None
a. LOC(Array[5]=Base(Array)+w(5-lower bound), where
w is the number of words per memory cell for the array
10. Each data item in a record may be a group item
b. LOC(Array[5])=Base(Array[5])+(5-lower bound),
composed of sub-items; those items which are
where w is the number of words per memory cell for the
indecomposable are called
array
a. elementary items
c. LOC(Array[5])=Base(Array[4])+(5-Upper bound),
b. atoms
where w is the number of words per memory cell for the
c. scalars
array
d. all of above
d. None of above
11. The difference between linear array and a record is
3. Which of the following data structures are indexed
a. An array is suitable for homogeneous data but hte
structures?
data items in a record may have different data type
a. linear arrays
b. In a record, there may not be a natural ordering in
b. linked lists
opposed to linear array. 20. When inorder traversing a tree resulted E A C K F H
c. A record form a hierarchical structure but a lienear D B G; the preorder traversal would return
array does not a. FAEKCDBHG
d. All of above b. FAEKCDHGB
c. EAFKHDCBG
12. Which of the following statement is false? d. FEAKDCHBG
a. Arrays are dense lists and static data structure
b. data elements in linked list need not be stored in
adjecent space in memory
c. pointers store the next data element of a list
d. linked lists are collection of the nodes that contain
Answers
information part and next pointer

13. Binary search algorithm can not be applied to 1. The memory address of the first element of an array
a. sorted linked list is called
b. sorted binary trees d. base address
c. sorted linear array
d. pointer array 2. The memory address of fifth element of an array can
be calculated by the formula
14. When new data are to be inserted into a data a. LOC(Array[5]=Base(Array)+w(5-lower bound), where
structure, but there is no available space; this situation w is the number of words per memory cell for the array
is usually called
a. underflow 3. Which of the following data structures are indexed
b. overflow structures?
c. housefull a. linear arrays
d. saturated
4. Which of the following is not the required condition for
15. The situation when in a linked list START=NULL is binary search algorithm?
a. underflow c. There must be mechanism to delete and/or insert
b. overflow elements in list
c. housefull
d. saturated 5. Which of the following is not a limitation of binary
search algorithm?
16. Which of the following is two way list? d. binary search algorithm is not efficient when the data
a. grounded header list elements are more than 1000.
b. circular header list
c. linked list with header and trailer nodes 6. Two dimensional arrays are also called
d. none of above c. both of above

17. Which of the following name does not relate to 7. A variable P is called pointer if
stacks? a. P contains the address of an element in DATA.
a. FIFO lists
b. LIFO list 8. Which of the following data structure can't store the
c. Piles non-homogeneous data elements?
d. Push-down lists a. Arrays

18. The term "push" and "pop" is related to the 9. Which of the following data structure store the non-
a. array homogeneous data elements?
b. lists b. Records
c. stacks
d. all of above 10. Each data item in a record may be a group item
composed of sub-items; those items which are
19. A data structure where elements can be added or indecomposable are called
removed at either end but not in the middle d. all of above
a. Linked lists
b. Stacks 11. The difference between linear array and a record is
c. Queues d. All of above
d. Deque
12. Which of the following statement is false?
c. pointers store the next data element of a list
c. Queues
13. Binary search algorithm can not be applied to d. All of above
a. sorted linked list
5. To represent hierarchical relationship between
14. When new data are to be inserted into a data elements, which data structure is suitable?
structure, but there is no available space; this situation a. Deque
is usually called b. Priority
b. overflow c. Tree
d. All of above
15. The situation when in a linked list START=NULL is
a. underflow 6. A binary tree whose every node has either zero or
two children is called
16. Which of the following is two way list? a. Complete binary tree
d. none of above b. Binary search tree
c. Extended binary tree
d. None of above
17. Which of the following name does not relate to
stacks?
a. FIFO lists 7. The depth of a complete binary tree is given by
a. Dn = n log2n
b. Dn = n log2n+1
18. The term "push" and "pop" is related to the
c. Dn = log2n
c. stacks
d. Dn = log2n+1
19. A data structure where elements can be added or
8. When representing any algebraic expression E
removed at either end but not in the middle
which uses only binary operations in a 2-tree,
d. Deque
a. the variable in E will appear as external nodes and
operations in internal nodes
20. When inorder traversing a tree resulted E A C K F H b. the operations in E will appear as external nodes and
D B G; the preorder traversal would return variables in internal nodes
b. FAEKCDHGB c. the variables and operations in E will appear only in
internal nodes

Set - 3 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
1. Which data structure allows deleting node
data elements from front and inserting at rear? b. by inserting an internal nodes for non-empty node
a. Stacks c. by inserting an external nodes for non-empty node
b. Queues d. by replacing each empty sub tree by a new external
c. Deques node
d. Binary search tree
10. When converting binary tree into extended binary
2. Identify the data structure which allows deletions at tree, all the original nodes in binary tree are
both ends of the list but insertion at only one end. a. internal nodes on extended tree
a. Input-restricted deque b. external nodes on extended tree
b. Output-restricted deque c. vanished on extended tree
c. Priority queues d. None of above
d. None of above
11. The post order traversal of a binary tree is DEBFCA.
3. Which of the following data structure is non-linear Find out the pre order traversal
type? a. ABFCDE
a. Strings b. ADBFEC
b. Lists c. ABDECF
c. Stacks d. ABDCEF
d. None of above
12. Which of the following sorting algorithm is of divide-
4. Which of the following data structure is linear type? and-conquer type?
a. Strings a. Bubble sort
b. Lists b. Insertion sort
c. Quick sort
d. All of above Answers:
13. An algorithm that calls itself directly or indirectly is
known as
a. Sub algorithm
b. Recursion 1. Which data structure allows deleting data elements
c. Polish notation from front and inserting at rear?
d. Traversal algorithm b. Queues

14. In a binary tree, certain null entries are replaced by 2. Identify the data structure which allows deletions at
special pointers which point to nodes higher in the tree both ends of the list but insertion at only one end.
for efficiency. These special pointers are called a. Input-restricted deque
a. Leaf
b. branch 3. Which of the following data structure is non-linear
c. path type?
d. thread d. None of above

15. The in order traversal of tree will yield a sorted 4. Which of the following data structure is linear type?
listing of elements of tree in d. All of above
a. Binary trees
b. Binary search trees 5. To represent hierarchical relationship between
c. Heaps elements, which data structure is suitable?
d. None of above c. Tree

16. In a Heap tree 6. A binary tree whose every node has either zero or
a. Values in a node is greater than every value in left two children is called
sub tree and smaller than right sub tree c. Extended binary tree
b. Values in a node is greater than every value in
children of it 7. The depth of a complete binary tree is given by
c. Both of above conditions applies d. Dn = log2n + 1
d. None of above conditions applies
8. When representing any algebraic expression E
17. In a graph if e=[u, v], Then u and v are called which uses only binary operations in a 2-tree,
a. endpoints of e a. the variable in E will appear as external nodes and
b. adjacent nodes operations in internal nodes
c. neighbors
d. all of above 9. A binary tree can easily be converted into q 2-tree
d. by replacing each empty sub tree by a new external
18. A connected graph T without any cycles is called node
a. a tree graph
b. free tree 10. When converting binary tree into extended binary
c. a tree tree, all the original nodes in binary tree are
d. All of above a. internal nodes on extended tree

19. In a graph if e=(u, v) means 11. The post order traversal of a binary tree is DEBFCA.
a. u is adjacent to v but v is not adjacent to u Find out the pre order traversal
b. e begins at u and ends at v c. ABDECF
c. u is processor and v is successor
d. both b and c 12. Which of the following sorting algorithm is of divide-
and-conquer type?
20. If every node u in G is adjacent to every other node c. Quick sort
v in G, A graph is said to be
a. isolated 13. An algorithm that calls itself directly or indirectly is
b. complete known as
c. finite b. Recursion
d. strongly connected
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
c. for both of above situation
15. The in order traversal of tree will yield a sorted d. for none of above situation
listing of elements of tree in
b. Binary search trees
4. If the values of a variable in one module is
16. In a Heap tree
b. Values in a node is greater than every value in indirectly changed by another module, this
children of it situation is called
17. In a graph if e=[u, v], Then u and v are called a. internal change
d. all of above
b. inter-module change
18. A connected graph T without any cycles is called c. side effect
d. All of above
d. side-module update
19. In a graph if e=(u, v) means
d. both b and c
5. In linear search algorithm the Worst case
20. If every node u in G is adjacent to every other node occurs when
v in G, A graph is said to be
b. complete a. The item is somewhere in the middle of the
Data Structures And Algorithms MCQ array
Questions
b. The item is not in the array at all
c. The item is the last element in the array
1. When determining the efficiency of
d. The item is the last element in the array or is
algorithm, the space factor is measured by
not there at all
a. Counting the maximum memory needed by the
algorithm 6. For an algorithm the complexity of the
b. Counting the minimum memory needed by the average case is
algorithm a. Much more complicated to analyze than that of
c. Counting the average memory needed by the worst case
algorithm b. Much more simpler to analyze than that of
d. Counting the maximum disk space needed by worst case
the algorithm c. Sometimes more complicated and some other
times simpler than that of worst case
2. The complexity of Bubble sort algorithm is
d. None or above
a. O(n)
b. O(log n) 7. The complexity of merge sort algorithm is
c. O(n2) a. O(n)
d. O(n log n) b. O(log n)
c. O(n2)
3. Linked lists are best suited
d. O(n log n)
a. for relatively permanent collections of data
b. for the size of the structure and the data in the 8. The complexity of linear search algorithm is
structure are constantly changing a. O(n)
b. O(log n) array
c. O(n2) b. When Item is not in the array at all
d. O(n log n) c. When Item is the last element in the array
d. When Item is the last element in the array or is
9. When determining the efficiency of algorithm not there at all
the time factor is measured by
a. Counting microseconds 14. Two main measures for the efficiency of an
b. Counting the number of key operations algorithm are
c. Counting the number of statements a. Processor and memory
d. Counting the kilobytes of algorithm b. Complexity and capacity
c. Time and space
10. Which of the following data structure is d. Data and space
linear data structure?
a. Trees 15. Finding the location of the element with a
b. Graphs given value is:
c. Arrays a. Traversal
d. None of above b. Search
c. Sort
11. The elements of an array are stored d. None of above
successively in memory cells because
a. by this way computer can keep track only the 16. Which of the following case does not exist in
address of the first element and the addresses of complexity theory
other elements can be calculated a. Best case
b. the architecture of computer memory does not b. Worst case
allow arrays to store other than serially c. Average case
c. both of above d. Null case
d. none of above
17. The operation of processing each element
12. Which of the following data structure is not in the list is known as
linear data structure? a. Sorting
a. Arrays b. Merging
b. Linked lists c. Inserting
c. Both of above d. Traversal
d. None of above
18. Arrays are best data structures
13. The Average case occur in linear search a. for relatively permanent collections of data
algorithm b. for the size of the structure and the data in the
a. When Item is somewhere in the middle of the structure are constantly changing
c. for both of above situation
d. for none of above situation A. Insertion Sort
B. Bubble Sort
19. Each array declaration need not give, C. Merge Sort
implicitly or explicitly, the information about D. Tree Sort
a. the name of array
b. the data type of array
3) Very slow way of sorting is ..........
c. the first data from the set to be stored
d. the index set of the array
A. Insertion sort

20. The complexity of Binary search algorithm


B. Heap sort
is
C. Bubble sort
a. O(n)
D. Quick sort
b. O(log )
c. O(n2)
4) Which of the following is an internal
d. O(n log n) sorting?

Correct Answers to Data Structures And A. Tape Sort

Algorithms MCQs B. 2-way Merge Sort


C. Merge Sort
1–A 2–B 3–B 4–C 5–D
D. Tree Sort

11 – A 12 – D 13 – A 14 – C 15 – B

5) Sorting a file F usually refers to sorting F


MCQ On Searching, Merging And with respect to a particular key called .....
Sorting Methods In Data Structure
Set-1 A. Basic key
B. Primary key
C. Starting key
D. Index key
1) Finding the location of a given item in a
collection of items is called ......
6) The time complexity of quick sort
is ........
A. Discovering
B. Finding
A. O(n)
C. Searching
B. O(logn)
D. Mining
C. O(n2)
D. O(n logn)
2) Which of the following is an external
sorting?
7) Selection sort first finds the ..........
element in the list and put it in the first 12) The easiest sorting is ........
position. A. quick sort
B. shell sort
A. Middle element C. heap sort
B. Largest element D. selection sort
C. Last element
D. Smallest element 13) Which of the following sorting algorithm
is of divide and conquer type?
8) Quick sort is also known as ........ A. Bubble sort
B. Insertion sort
A. merge sort C. Quick sort
B. tree sort D. Merge sort
C. shell sort 14) Merging k sorted tables into
D. partition and exchange sort a single sorted table is called ......
A. k way merging
9) The operation that combines the element B. k th merge
is of A and B in a single sorted list C with C. k+1 merge
n=r+s element is called .... D. k-1 merge
15) The function used to modify the way of
A. Inserting sorting the keys of records is called ........
B. Mixing A. Indexing function
C. Merging B. Hash function
D. Sharing C. Addressing function
D. All of the above
10) A tree sort is also known as ......... sort.
16) If the number of record to be sorted
A. quick large and the key is short, then ...... sorting
B. shell can be efficient.
C. heap
D. selection A. Merge
B. Heap
11) .......... sorting is good to use when C. Radix
alphabetizing large list of names. D. Bubble
17) The total number of comparisons in a
A. Merge bubble sort is ....
B. Heap A. O(n logn)
C. Radix B. O(2n)
D. Bubble C. O(n2)
D. O(n) 18) C. Quick
18) If the number of record to be sorted 19) D. O(n logn)
large and the key is long, then ...... sorting 20) B. O(n2)
can be efficient.
Interview Questions On Stack And
A. Merge
Queue In Data Structure Set-2
B. Heap
C. Quick
1) The queue in which the insertion takes
D. Bubble
place in the first position after of last
19) The time complexity of heap sort is ....
element is a ......
A. O(n)
B. O(logn)
A. priority
C. O(n2)
B. dequeue
D. O(n logn)
C. circular
20) The complexity of selection sort is .......
D. linked

A. O(n)
2) Before inserting into stack one must
B. O(n2)
check the condition .........
C. O(n logn)
A. Overflow
D. O(logn)
B. Underflow
Answers: C. Maximum elements
D. Existing elements
1) C. Searching 3) The another name of dequeue is .........
2) C. Merge Sort A. divided queue
3) A. Insertion sort B. distributed queue
4) D. Tree Sort C. double ended queue
5) B. Primary key D. design queue
6) D. O(n logn)
7) D. Smallest element 4) Before deletion condition into stack ......
8) D. partition and exchange sort has to be checked.
9) C. Merging A. Overflow
10) C. heap
11) C. Radix B. Underflow
12) D. selection sort C. Maximum elements
13) C. Quick sort D. Existing elements
14) A. k way merging
15) B. Hash function 5) In dequeue, insertion and deletion takes
16) C. Radix place of ..........
17) A. O(n logn) A. front, rear end
B. only at rear end
C. only at front end 10) The condition ........ indicate the queue
D. both the ends is empty.

6) When does Top value of stack change in A. Front=Null


insertion process? B. Null=Front
A. Before insertion C. Front=Rear
B. After insertion D. Rear=Null
C. At the time of insertion
D. While checking overflow

7) A queue in which insertion and deletion 11) Which of the following is not the type of
takes places from any positionis called ...... queue?

A. circular queue A. Ordinary queue


B. Special queue
B. random of queue C. Priority queue
D. Circular queue
C. priority
12) The value of REAR is increased by 1
D. dequeue when .......

A. An element is deleted in a queue


8) Deletion in the linked stack takes place B. An element is traversed in a queue
by deleting ........ C. An element is added in a queue
D. An element is merged in a queue
A. Node pointed by the start process.

B. End of the list 13) The operations that can be done in a


C. Beginning of the list circular queue is/are .....
D. Middle of the list
A. Insert from the front end
9) Which of the following name does not B. Delete from front end
relate to stacks? C. Display queue contents
D. All of the above
A. FIFO lists
B. LIFO list 14) The term dequeue is the contraction of
C. piles the name ........
D. push-down lists
A. Double ended queue
B. Double sided queue A. front
C. Double headed queue B. rear
D. Double address queue C. top
D. link
15) The various operations that can be
performed on stacks is/are ..... 20) Reversing a great deal of space for each
stack in memory will ...........
A. Insert an item into the stack A. Decrease the numbers of times overflow
B. Delete an item from the stack may occur
C. Display the contents of the stack B. Increase the numbers of times overflow
D. All of the above may occur
C. Increase the number of times underflow
16) ............. is a collection of elements may occur
such that each element has been assigned D. Increase the number of times underflow
a processing priority. may occur.

Answers:
A. Priority queue
B. Procedure queue
1) C. circular
C. Main queue
2) A. Overflow
D. Interrupt queue
3) C. double ended queue
4) B. Underflow
17) The deletion operation in stack is
5) D. both the ends
called ......
6) A. Before insertion
A. insert
7) C. priority
B. push
8) A. Node pointed by the start process
C. pop
9) A. FIFO lists
D. top
10) A. Front=Null
11) B. Special queue
18) Link fields holds pointers to the ..........
12) C. An element is added in a queue
element in the linked representation of
13) D. All of the above
stack.
14) A. Double ended queue
15) D. All of the above
A. Neighbouring
16) A. Priority queue
B. Last
17) C. pop
C. First
18) A. Neighbouring
D. Middle
19) C. top
20) A. Decrease the numbers of times
19) The pointer associated with the stack
overflow may occur
is ...........
Solved MCQ On Tree And Graph In is called ........
Data Structure Set-1 A. free graph
B. no cycle graph
1) The operation of processing each element C. non cycle graph
in the list is known as ...... D. circular graph
A. sorting
B. merging 7) Trees are said .......... if they are similar
C. inserting and have same contents at corresponding
D. traversal nodes.
A. Duplicate
2) Other name for directed graph is .......... B. Carbon copy
A. Direct graph C. Replica
B. Digraph D. Copies
C. Dir-graph
D. Digraph 8) A connected graph T without any cycles
is called a ........
3) Binary trees with threads are called
as ....... A. A tree graph
A. Threaded trees B. Free tree
B. Pointer trees C. A tree d
C. Special trees D. All of the above
D. Special pointer trees
4) Graph G is .............. if for any pair u, v 9) Every node N in a binary tree T except
of nodes in G there is a path from u to v or the root has a unique parent called
path from v to u. the ......... of N.
A. Leterally connected A. Antecedents
B. Widely Connected B. Predecessor
C. Unliterally connected C. Forerunner
D. Literally connected D. Precursor

5) In Binary trees nodes with no successor 10) In a graph if E=(u,v) means ......
are called ......
A. u is adjacent to v but v is not adjacent to
A. End nodes u
B. Terminal nodes B. e begins at u and ends at v
C. Final nodes C. u is processor and v is successor
D. Last nodes D. both b and c

6) A connected graph T without any cycles 11) Sequential representation of binary tree
uses ........ A. Exterior node
B. Outside node
A. Array with pointers C. Outer node
B. Single linear array D. External node
C. Two dimentional arrays
D. Three dimentional arrays 18) Which indicates pre-order traversal?
A. Left sub-tree, Right sub-tree and root
12) In a graph if e=[u,v], Then u and v are B. Right sub-tree, Left sub-tree and root
called ........ C. Root, Left sub-tree, Right sub-tree
D. Right sub-tree, root, Left sub-tree
A. End points of e
B. Adjacent nodes 19) In a extended-binary tree nodes with 2
C. Neighbours children are called ........
D. All of the above A. Interior node
13) TREE[1]=NULL indicates tree is ........ B. Domestic node
A. Overflow C. Internal node
B. Underflow D. Inner node
C. Empty 20) A terminal node in a binary tree is called
D. Full ............
14) A binary tree whose every node has A. Root
either zero or two children is called ....... B. Leaf
A. complete binary tree C. Child
B. binary search tree D. Branch
C. extended binary tree
Answers:
D. data structure
1) D. traversal
15) Linked representation of binary tree
2) D. Digraph
needs ......... parallel arrays.
A. 4 3) A. Threaded trees
B. 2 4) C. Unliterally connected
C. 3 5) B. Terminal nodes
D. 5 6) A. free graph
16) The depth of complete binary tree is 7) D. Copies
given by ...... 8) D. All of the above
A. Dn = n log2n 9) B. Predecessor
B. Dn= n log2n+1 10) D. both b and c
C. Dn = log2n 11) A. Array with pointers
D. Dn = log2n+1 12) D. All of the above
17) In a 2-tree, nodes with 0 children are 13) C. Empty
called ............ 14) C. extended binary tree
15) C. 3 nodes higher in the tree for efficiency. These
16) D. Dn = log2n+1 special pointers are called .........
17) D. External node
A. Leaf
18) C. Root, Left sub-tree, Right sub-tree
B. Branch
19) C. Internal node
C. Path
20) B. Leaf
D. Thread
Objective Questions On Tree And
Graph In Data Structure Set-2 5) In a head tree .....
1) The post order traversal of binary tree is
A. values in a node is greater than every
DEBFCA. Find out the pre order traversal.
value every value in left sub tree and
A. ABFCDE smaller than right sub tree.

B. ADBFEC B. values in a node is greater than every


value in children of it.
C. ABDECF
C. conditions.
D. ABDCEF
D. terms.
2) While converting binary tree into
extended binary tree, all the original nodes 6) The in order traversal of tree will yield a
in binary tree are ....... sorted listing of elements oftree in ....

A. Internal nodes on extended tree A. Binary trees

B. External nodes on extended tree B. Binary search trees

C. Vanished on extended tree C. Merging

D. Intermediate nodes on extended tree D. AVL Trees

3) The in-order traversal of tree will yield a 7) In a graph if e=(u,v) means .......
sorted listing of elements oftree in ........
A. u is adjacent to v but v is not adjacent to
A. binary trees u.

B. binary search trees B. e begins at u and ends at v

C. heaps C. u is node and v is an edge.

D. binary heap D. both u and v are edges.

4) In a binary tree, certain null entries are 8) A binary tree whose every node has
replaced by special pointers which point to either zero or two children is called .........
A. Complete binary tree C. EAFKHDCBG

B. Binary Search tree D. FEAKDCHBG

C. Extended binary tree 13) A connected graph T without any cycles


is called .
D. E2 tree
A. a tree graph
9) If every node u in G is adjacent to every
other node v in G,A graph is said to be ....... B. free tree

A. isolated C. a tree

B. complete D. All of above

C. finite 14) In linked representation of Binary trees


LEFT[k] contains the ........ of at the node N,
D. strongly connected.
where k is the location.
10) The post order traversal of a binary tree
A. Data
is DEBFCA. Find out the pre order Traversal.
B. Location and left child
A. ABFCDE
C. Right child address
B. ADBFEC
D. Null value
C. ABDECF
15) If every node u in G adjacent to every
D. ABDCEF
other node v in G, A graph is said to be
11) In a graph if e=[u,v], then u and v are
A. isolated
called
B. complete
A. endpoints of e
C. finite
B. adjacent nodes
D. strongly connected
C. neighbours
16) Three standards ways of traversing a
D. all of the above
binary tree T with root R .......
12) In-order traversing a tree resulted E A C
A. Prefix, infix, postfix
K F H D B G; the pre-order traversal would
return. B. Pre-process, in-process, post-process

A. FAEKCDBHG C. Pre-traversal, in-traversal, post-traversal

B. FAEKCDHGB D. Pre-order, in-order, post-order


17) A graph is said to be ....... if every node 2) A. Internal nodes on extended tree
u in G is adjacent to every other node v in
3) B. binary search trees
G.
4) D. Thread
A. Absolute
5) B. values in a node is greater than every
B. Entire
value in children of it.
C. Inclusive
6) B. Binary search trees
D. Complete
7) B. e begins at u and ends at v
18) In threaded binary tree ......... points to
8) C. Extended binary tree
higher nodes in tree.
9) B. complete
A. Info
10) C. ABDECF
B. Root
11) D. all of the above
C. Threads
12) B. FAEKCDHGB
D. Child
13) D. All of above
19) A graph is said to be ....... if its edges
are assigned data. 14) A. Data

A. Tagged 15) B. complete

B. Marked 16) D. Pre-order, in-order, post-order

C. Lebeled 17) D. Complete

D. Sticked 18) C. Threads

20) If node N is a terminal node in a binary 19) C. Lebeled


tree then its .........
20) C. Both left & right sub trees are empty
A. Right tree is empty
Solved MCQ Of Data Structure Set-
B. Left tree is empty 1
C. Both left & right sub trees are empty

D. Root node is empty


1. Which if the following is/are the levels of
Answers: implementation of datastructure
1) C. ABDECF
A) Abstract level
B) Application level C) True, True

C) Implementation level D) False, False

D) All of the above


6. …………… is not the component of
data structure.
2. A binary search tree whose left subtree
and right subtree differ in hight by at most 1 A) Operations
unit is called …… B) Storage Structures
C) Algorithms
A) AVL tree D) None of above
B) Red-black tree
C) Lemma tree
D) None of the above 7. Which of the following is not the part of
ADT description?
3. ……………….. level is where the model A) Data
becomes compatible executable code B) Operations
A) Abstract level C) Both of the above
B) Application level D) None of the above
C) Implementation level 8. Inserting an item into the stack when
D) All of the above stack is not full is called …………. Operation
4. Stack is also called as and deletion of item form the stack, when
A) Last in first out stack is not empty is called ………..operation.
B) First in last out
A) push, pop
C) Last in last out
D) First in first out B) pop, push
5. Which of the following is true about the
characteristics of abstract data types? C) insert, delete

i) It exports a type. D) delete, insert


9. ……………. Is a pile in which items are
ii) It exports a set of operations added at one end and removed from the
other.
A) True, False A) Stack
B) Queue
B) False, True C) List
D) None of the above A) Graphs
B) Stacks
10. ………… is very useful in situation when C) Binary tree
data have to stored and then retrieved in D) Queues
reverse order. 16. Which data structure is used in breadth
A) Stack first search of a graph to hold nodes?
B) Queue A) Stack
C) List B) queue
D) Link list C) Tree
11. Which data structure allows deleting D) Array
data elements from and inserting at rear?
A) Stacks 17. Identify the data structure which allows
B) Queues deletions at both ends of the list but
C) Dequeues insertion at only one end.
D) Binary search tree A) Input restricted dequeue
12. Which of the following
data structure can't store the non- B) Output restricted qequeue
homogeneous data elements?
C) Priority queues
A) Arrays D) Stack
B)Records 18. Which of the following data structure is
C) Pointers non linear type?
D) Stacks A) Strings
13. A ....... is a data structure that B) Lists
organizes data similar to a line in the C) Stacks
supermarket, where the first one in line is D) Graph
the first one out. 19. Which of the following data structure is
linear type?
A) Queue linked list A) Graph
B) Stacks linked list B) Trees
C) Both of them C) Binary tree
D) Neither of them D) Stack
14. Which of the following is non-liner 20. To represent hierarchical relationship
data structure? between elements, Which datastructure is
A) Stacks suitable?
B) List A) Dequeue
C) String B) Priority
D) Trees C) Tree
15. Herder node is used as sentinel in ..... D) Graph
Answers: D. traversal
1. D) All of the above
3) The situation when in a linked
2. A) AVL tree
list START=NULL is ....
3. C) Implementation level
4. A) Last in first out A. Underflow
5. C) True, True
B. Overflow
6. D) None of above
7. D) None of the above C. Houseful
8. A) push, pop
9. B) Queue D. Saturated

10. A) Stack
4) Each node in singly linked list has ........
11. B) Queues
fields.
12. A) Arrays
13. A) Queue linked list A. 2
14. D) Trees
B. 3
15. C) Binary tree
16. B) queue C. 1
17. A) Input restricted dequeue
D. 4
18. D) Graph
19. D) Stack 5) Which of the following is two way lists?
20. C) Tree
A. Grounded header list
1) Linked lists are best suited .....
B. Circular header list

C. Linked list with header and trailer nodes


A. for relatively permanent collections of
D. List traversed in two directions
data.

6) Which is the pointer associated with the


B. for the size of the structure and the data
availability list?
in the structure are constantly changing.

A. FIRST
C. data structure

B. AVAIL
D. for none of above situation

C. TOP
2) The operation of processing each element
in the list is known as ...... D. REAR

A. sorting 7) Value of first linked list index is ....

B. merging A. 0

C. inserting
B. 1 12) LLINK is the pointer pointing to the ...

C. -1 A. successor node

D. 2 B. predecessor node

8) In linked lists there are no NULL links in C. head node

A. single linked list D. last node

B. linear doubly linked list 13) .......... refers to a linear collection of


data items.
C. circular linked list
A. List
D. linked list
B. Tree
9) Each node in a linked list must contain at
least ..... C. Graph

A. Three fields D. Edge

B. Two fields 14) A run list is ......

C. Four fields A. small batches of records from a file

D. Five fields B. number of elements having same value

10) The dummy header in linked list contain C. number of records

A. first record of the actual data D. number of files in external storage

B. last record of the actual data 15) A ...... indicates the end of the list.

C. pointer to the last record of the actual A. Guard


data
B. Sentinel
D. middle record of the actual data
C. End pointer
11) In a linked list the .......... field contains
D. Last pointer
the address of next element in the list.
16) A ........ is a linear list in which
A. Link field
insertions and deletions are made to from
B. Next element field either end of the structure.

C. Start field A. circular queue

D. Info field B. random of queue


C. priority Answers:
1) B. for the size of the structure and the
D. dequeu
data in the structure are constantly
17) Indexing the ........ element in the list is changing.
not possible in linked lists.
2) D. traversal
A. middle
3) A. Underflow
B. first
4) A. 2
C. last
5) D. List traversed in two directions
D. any where in between
6) B. AVAIL
18) A linear list in which the pointer points
7) A. 0
only to the successive node is ......
8) C. circular linked list
A. singly linked list
9) B. Two fields
B. circular linked list
10) A. first record of the actual data
C. doubly linked list
11) A. Link field
D. none of the above
12) B. predecessor node
19) .......... may take place only when there
is some minimum amount(or) no space left 13) A. List
in free storage list.
14) A. small batches of records from a file
A. Memory management
15) B. Sentinel
B. Garbage collection
16) D. dequeue
C. Recycle bin
17) A. middle
D. Memory management
18) A. singly linked list
20) A linear list in which the last node points
19) B. Garbage collection
to the first node is ........
20) B. circular linked list
A. singly linked list
1. A directed graph is ………………. if there is a
B. circular linked list path from each vertex to every other vertex
in the digraph.
C. doubly linked list
A) Weakly connected
D. none of the above
B) Strongly Connected
A) (N/2)+1
C) Tightly Connected
B) (N+1)/2
D) Linearly Connected
C) (N-1)/2

D) (N+2)/2
2. In the …………….. traversal we process all 6. In ……………, search start at the beginning
of a vertex’s descendents before we move of the list and check everyelement in the
to an adjacent vertex. list.
A) Depth First A) Linear search
B) Breadth First
C) With First B) Binary search
D) Depth Limited
C) Hash Search
3. State True of False.
D) Binary Tree searc
i) Network is a graph that has weights or
costs associated with it. 7. State True or False.
ii) An undirected graph which contains no
cycles is called a forest. i) Binary search is used for searching in a
iii) A graph is said to be complete if there is sorted array.
no edge between every pair of vertices.
A) True, False, True ii) The time complexity of binary search is
B) True, True, False O(logn).
C) True, True, True
D) False, True, True A) True, False
4. Match the following.
a) Completeness i) How long does it B) False, True
take to find a solution
b) Time Complexity ii) How much memory C) False, False
need to perform the search.
c) Space Complexity iii) Is the strategy D) True, True
guaranteed to find the solution when there
in one. 8. Which of the following is not the internal
sort?
A) a-iii, b-ii, c-i A) Insertion Sort

B) a-i, b-ii, c-iii B) Bubble Sort

C) a-iii, b-i, c-ii C) Merge Sort

D) a-i, b-iii, c-ii D) Heap Sort


5. The number of comparisons done by 9. State True or False.
sequential search is ………………
i) An undirected graph which contains no list backwards.
cycles is called forest.
ii) To find the predecessor, it is required to
ii) A graph is said to be complete if there is traverse the list from the first node in case
an edge between every pair of vertices. of singly linked list.

A) True, True A) i-only

B) False, True B) ii-only

C) False, False C) Both i and ii

D) True, False D) None of both


10. A graph is said to be ……………… if the 14. The advantage of …………….. is that they
vertices can be split into two sets V1 and V2 solve the problem if sequential storage
such there are no edges between two representation. But disadvantage in that is
vertices of V1 or two vertices of V2. they are sequential lists.
A) Partite
B) Bipartite A) Lists
C) Rooted
D) Bisects B) Linked Lists
11. In a queue, the initial values of front
pointer f rare pointer r should be …….. and C) Trees
……….. respectively.
D) Queues
A) 0 and 1
15. What will be the value of top, if there is
B) 0 and -1 a size of stack STACK_SIZE is 5

C) -1 and 0 A) 5

D) 1 and 0 B) 6
12. In a circular queue the value of r will
be . C) 4
A) r=r+1
D) None
B) r=(r+1)% [QUEUE_SIZE – 1]
16. ………… is not the operation that can be
C) r=(r+1)% QUEUE_SIZE performed on queue.
A) Insertion
D) r=(r-1)% QUEUE_SIZE B) Deletion
C) Retrieval
13. Which of the following statement is D) Traversal
true? 17. There is an extra element at the head
i) Using singly linked lists and circular list, it of the list called a ……….
is not possible to traverse the A) Antinel
B) Sentinel 2) A singly linked list is also called as ........
C) List header
D) List head A. linked list
18. A graph is a collection of nodes, called
………. And line segments called arcs or B. one way chain
……….. that connect pair of nodes.
C. two way chain
A) vertices, edges
D. right link
B) edges, vertices
3) A ..... list is a header list where the node
points back to the header node.
C) vertices, paths
A. Circular header
D) graph node, edges
B. Grounded header
19. A ……….. is a graph that has weights of
costs associated with its edges. C. Two way header

A) Network D. One way heade

B) Weighted graph 4) A doubly linked list has .......... pointers


with each node.
C) Both A and B
A. 0
D) None A and B
B. 1

20. In general, the binary search method


C. 2
needs no more than ……………. comparisons.
D. 3
A) [log2n]-1
5) Header linked lists are frequently used
B) [logn]+1 for maintaining ........ in memory.

C) [log2n] A. Polynomials

D) [log2n]+1 B. Binomial

1) To insert a new node in linked list free C. Trinomial

node will be available in ........ D. Quadratic equation

A. Available list 6) The pointer that points to the first node

B. Avail list in the list is ........

C. Free node list A. FIRST

D. Memory space list B. AVAIL


C. TOP 11) The list which has its own pointer is
called ........
D. REAR
A. pointer list
7) Two-way list may be maintained in
memory by means of ............. B. self pointer

C. free pool

A. Queues D. own pointer

B. Linear arrays 12) Which of the following is two way lists?

C. Non linear arrays A. Grounded header list

D. Stacks B. Circular header list

8) A doubly linked list is also called C. Linked list with header and trailer nodes
as ..........
D. None of the above
A. linked list
13) A .......... is a header list where the last
B. one way chain node contains the null pointer.

C. two way chain A. grounded header list

D. right link B. bottom header list

9) The list that requires two pointer C. dow header list


variables FIRST and LAST is called ........
D. ropped header list
A. Circular list
14) RLINK is the pointer pointing to the ...
B. Header list
A. successor node
C. One way list
B. predecessor node
D. Two way list
C. head node
10) If the availability list is null, then the
D. last node
condition is said to be .........
15) A ............. is a header list where the
A. nil block
last node points back to the header node.
B. availability list underflow
A. rounded header list
C. availability list overflow
B. circular header list
D. memory loss
C. common header list 20) A linear list in which each node has
point to the predecessor and successors
D. forward header list
nodes is called ........
16) In a linked list, insertion can be done as
A. singly linked list
.......
B. circular linked list
A. beginning
C doubly linked list
B. end
D. linear linked list
C. middle
Answers:
D. all of the above
1) B. Avail list
17) In a two-way lists each node is divided
2) B. one way chain
into .......parts.
3) A. Circular header
A. 1
4) C. 2
B. 2
5) A. Polynomials
C. 3
6) A. FIRST
D. 4
7) B. Linear arrays
18) The disadvantage in using
a circular linked list is ....... 8) C. two way chain

A. it is possible to get into infinite loop 9) D. Two way list

B. last node points to fist node. 10) B. availability list underflow

C. time consuming 11) C. free pool

D. requires more memory space. 12) D. None of the above

19) Which of the following conditions checks 13) A. grounded header list
available free space in avail list?
14) A. successor node
A. Avail=Null
15) B. circular header list
B. Null=Avail
16) D. all of the above
C. Avail=Max stack
17) C. 3
D. Avail=Top
18) A. it is possible to get into infinite loop
19) A. Avail=Null C) Vertical array

20) C. doubly linked list D) Horizontal array

A) Strings 6. Arrays are best data structures ............


B) Lists
A) For relatively permanent collections of
C) Stacks data.

D) Tree B) For the size of the structure and the data


in he structure are constantly changing
2. Which of the following data structure is
linear type? C) For both of above situation

A) Array D) For none of the abov

B) Tree 7. Which of the following data structures are


indexed structures?
C) Graphs
A) Linear arrays
D) Hierarchy
B) Linked lists
3. The logical or mathematical model of a
particular organization of data is called a C) Graphs

A) Data structure D) Tree

B) Data arrangement 8. Each node in a linked list has two pairs of


.............. and ...................
C) Data configuration
A) Link field and information field
D) Data formation
B) Link field and avail field
4. The simplest type of
data structure is .................. C) Avail field and information field

A) Multidimensional array D) Address field and link field

B) Linear array 9. A ....................... does not keep track of


address of every element inthe list.
C) Two dimensional array
A) Stack
D) Three dimensional array
B) String
5. Linear arrays are also called
C) Linear array
A) Straight line array
D) Queue
B) One-dimensional array
10. When does top value of the stack 8. Each node in a linked list has two pairs of
changes? .............. and ...................

A) Before deletion A) Link field and information field

B) While checking underflow 9. A ........................ does not keep track


of address of every element inthe list.
C) At the time of deletion
C) Linear array
D) After deletio
10. When does top value of the stack
Answers:
changes?
1. Which of the following data structure is
non-linear type? D) After deletion

D) Tree

2. Which of the following data structure is


linear type?

A) Array

3. The logical or mathematical model of a


particular organization of data is called
a .........

A) Data structure

4. The simplest type of data structure


is ..................

B) Linear array

5. Linear arrays are also


called ...................

B) One-dimensional array

6. Arrays are best data structures ............

B) For the size of the structure and the data


in the structure are constantly changing

7. Which of the following data structures are


indexed structures?

A) Linear array

You might also like