Olete.in
Articles
Mock Tests
🧪 Data structure MCQ Quiz Hub
Data Structures and algorithms MCQ Questions
Choose a topic to test your knowledge and improve your Data structure skills
1. When determining the efficiency of algorithm the space factor is measured by
Counting the maximum memory needed by the algorithm
Counting the minimum memory needed by the algorithm
Counting the average memory needed by the algorithm
Counting the maximum disk space needed by the algorithm
2. The complexity of Bubble sort algorithm
O(n)
O(log n)
O(n2)
O(n log n)
3. Linked lists are best suited
for relatively permanent collections of data
for the size of the structure and the data in the structure are constantly changing
for both of above situation
for none of above situation
4. If the values of a variable in one module is indirectly changed by another module this situation is called
internal change
inter-module change
side effect
side-module update
5. In linear search algorithm the Worst case occurs when
The item is somewhere in the middle of the array
The item is not in the array at all
The item is the last element in the array
The item is the last element in the array or is not there at all
6. For an algorithm the complexity of the average case is
Much more complicated to analyze than that of worst case
Much more simpler to analyze than that of worst case
Sometimes more complicated and some other times simpler than that of worst case
None or above
7. The complexity of linear search algorithm is
O(n)
O(log n)
O(n2)
O(n log n)
8. The complexity of linear search algorithm is
O(n)
O(log n)
O(n2)
O(n log n)
9. When determining the efficiency of algorithm the time factor is measured by
Counting microseconds
Counting the number of key operations
Counting the number of statements
Counting the kilobytes of algorithm
10. Which of the following data structure is linear data structure?
Trees
Graphs
Arrays
None of above
11. The elements of an array are stored successively in memory cells because
by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
the architecture of computer memory does not allow arrays to store other than serially
both of above
none of above
12. Which of the following data structure is not linear data structure?
Arrays
Linked lists
both of above
none of above
13. he Average case occur in linear search algorithm
When Item is somewhere in the middle of the array
When Item is not in the array at all
When Item is the last element in the array
When Item is the last element in the array or is not there at all
14. Two main measures for the efficiency of an algorithm are
Processor and memory
Complexity and capacity
Time and space
Data and space
15. Finding the location of the element with a given value is
Traversal
Search
Sort
None of above
16. Which of the following case does not exist in complexity theory
Best case
Worst case
Average case
Null case
17. The operation of processing each element in the list is known as
Sorting
Merging
Inserting
Traversal
18. Arrays are best data structures
for relatively permanent collections of data
for the size of the structure and the data in the structure are constantly changing
for both of above situation
for none of above situation
19. Each array declaration need not give implicitly or explicitly the information about
the name of array
the data type of array
the first data from the set to be stored
the index set of the array
20. The complexity of Binary search algorithm is
O(n)
O(log)
O(n2)
O(n log n)
21. Each data item in a record may be a group item composed of sub-items; those items which are indecomposable are called
elementary items
atoms
scalars
all of above
22. Which of the following is two way list?
grounded header list
circular header list
linked list with header and trailer nodes
none of above
23. Which of the following statement is false?
Arrays are dense lists and static data structure
data elements in linked list need not be stored in adjacent space in memory
pointers store the next data element of a list
linked lists are collection of the nodes that contain information part and next poin
24. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would return
FAEKCDBHG
FAEKCDHGB
EAFKHDCBG
FEAKDCHBG
25. The memory address of the first element of an array is called
floor address
foundation address
first address
base address
26. The difference between linear array and a record is
An array is suitable for homogeneous data but the data items in a record may have different data type
In a record there may not be a natural ordering in opposed to linear array.
A record form a hierarchical structure but a linear array does not
All of above
27. Which of the following name does not relate to stacks?
FIFO lists
LIFO list
Piles
Push-down lists
28. Which of the following data structures are indexed structures?
linear arrays
linked lists
both of above
none of above
29. The term “push” and “pop” is related to the
array
lists
stacks
all of above
30. The memory address of fifth element of an array can be calculated by the formula
LOC(Array[5]=Base(Array)+w(5-lower bound) where w is the number of words per memory cell for the array
LOC(Array[5])=Base(Array[5])+(5-lower bound) where w is the number of words per memory cell for the array
LOC(Array[5])=Base(Array[4])+(5-Upper bound) where w is the number of words per memory cell for the array
None of above
31. Two dimensional arrays are also called
tables arrays
matrix arrays
both of above
none of above
32. When new data are to be inserted into a data structure but there is no available space; this situation is usually called
underflow
overflow
housefull
saturated
33. The situation when in a linked list START=NULL is
underflow
overflow
housefull
saturated
34. A variable P is called pointer if
P contains the address of an element in DATA.
P points to the address of first element in DATA
P can store only memory addresses
P contain the DATA and the address of DATA
35. Which of the following data structure can’t store the non-homogeneous data elements?
Arrays
Records
Pointers
None
36. Which of the following data structure store the homogeneous data elements?
Arrays
Records
Pointers
None
37. Which of the following is not a limitation of binary search algorithm?
must use a sorted array
requirement of sorted array is expensive when a lot of insertion and deletions are needed
there must be a mechanism to access middle element directly
binary search algorithm is not efficient when the data elements are more than 1000.
38. Binary search algorithm can not be applied to
sorted linked list
sorted binary trees
sorted linear array
pointer array
39. A data structure where elements can be added or removed at either end but not in the middle
Linked lists
Stacks
Queues
Deque
40. Which of the following is not the required condition for binary search algorithm?
The list must be sorted
there should be the direct access to the middle element in any sublist
There must be mechanism to delete and/or insert elements in list
none of above
Submit