Home

Data Structure 1000+ MCQ with answer for UPSC CDS

Thursday 9th of March 2023

Sharing is caring

1. Which of the following is not the required condition for binary search algorithm?
A. The list must be sorted
B. there should be the direct access to the middle element in any sublist
C. There must be mechanism to delete and/or insert elements in list
D. none of above
Answer : C
2. Which data structure allows deleting data elements from and inserting at rear?
A. Stacks
B. Dequeues
C. Queues
D. Binary search tree
Answer : C
3. Which of the following data structure cant store the non-homogeneous data elements?
A. Arrays
B. Records
C. Pointers
D. None
Answer : A
4. _____ is not the component of data structure.
A. Operations
B. Algorithms
C. Storage Structures
D. None of above
Answer : D
5. Which of the following data structure is not linear data structure?
A. Arrays
B. Linked lists
C. Both of above
D. None of above
Answer : D
6. Finding the location of the element with a given value is:
A. Traversal
B. Search
C. Sort
D. None of above
Answer : B
7. ……………. Is a pile in which items are added at one end and removed from the other.
A. Queue
B. Stack
C. List
D. None of the above
Answer : A
8. Which of the following is not the part of ADT description?
A. Data
B. Operations
C. Both of the above
D. None of the above
Answer : D
9. 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
D. The item is the last element in the array or is not there at all
Answer : D
10. Merge sort uses ?
A. Divide and conquer strategy
B. Backtracking approach
C. Heuristic search
D. Greedy approach
Answer : A
11. Which of the following algorithm design technique is used in the quick sort algorithm?
A. Dynamic programming
B. Greedy method
C. Divide and conquer
D. Backtracking
Answer : C
12. ______ is very useful in situation when data have to stored and then retrieved in reverse order.
A. Stack
B. Queue
C. List
D. Link list
Answer : A
13. Which of the following statement is false?
A. Arrays are dense lists and static data structure
B. data elements in linked list need not be stored in adjacent space in memory
C. pointers store the next data element of a list
D. linked lists are collection of the nodes that contain information part and next pointer
Answer : C
14. Which of the following is true about the characteristics of abstract data types?
i) It exports a type.
ii) It exports a set of operations

A. True, False
B. False, True
C. True, True
D. False, False
Answer : C
15. Inserting an item into the stack when stack is not full is called _______ Operation and deletion of item form the stack, when stack is not empty is called _______operation.
A. push, pop
B. insert, delete
C. pop, push
D. delete, insert
Answer : A
16. A data structure where elements can be added or removed at either end but not in the middle
A. Linked lists
B. Stacks
C. Queues
D. Deque
Answer : D
17. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would return
A. FAEKCDBHG
B. FAEKCDHGB
C. EAFKHDCBG
D. FEAKDCHBG
Answer : B
18. Two dimensional arrays are also called
A. tables arrays
B. matrix arrays
C. both of above
D. none of above
Answer : C
19. A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called ……
A. AVL tree
B. Red-black tree
C. Lemma tree
D. None of the above
Answer : A
20. The term push and pop is related to the
A. array
B. lists
C. stacks
D. all of above
Answer : C
21. Which of the following data structure is linear type?
A. Graph
B. Binary tree
C. Trees
D. Stack
Answer : D
22. The difference between linear array and a record is
A. An array is suitable for homogeneous data but the data items in a record may have different data type
B. In a record, there may not be a natural ordering in opposed to linear array.
C. A record form a hierarchical structure but a linear array does not
D. All of above
Answer : D
23. Each array declaration need not give, implicitly or explicitly, the information about
A. the name of array
B. the data type of array
C. the index set of the array
D. the first data from the set to be stored
Answer : D
24. Which of the following data structure can't store the non-homogeneous data elements?
A. Arrays
B. Records
C. Pointers
D. Stacks
Answer : A
25. 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 : B
26. The complexity of Binary search algorithm is
A. O(n)
B. O(log )
C. O(n2)
D. O(n log n)
Answer : B
27. Arrays are best data structures
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 : A
28. A variable P is called pointer if
A. P contains the address of an element in DATA.
B. P points to the address of first element in DATA
C. P can store only memory addresses
D. P contain the DATA and the address of DATA
Answer : A
29. To represent hierarchical relationship between elements, Which data structure is suitable?
A. Tree
B. Graph
C. Priority
D. Dequeue
Answer : A
30. 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
31. The complexity of linear search algorithm is
A. O(n)
B. O(log n)
C. O(n2)
D. O(n log n)
Answer : A
32. Which of the following data structures are indexed structures?
A. linear arrays
B. linked lists
C. both of above
D. none of above
Answer : A
33. The complexity of Bubble sort algorithm is
A. O(n)
B. O(log n)
C. O(n2)
D. O(n log n)
Answer : B
34. Which data structure is used in breadth first search of a graph to hold nodes?
A. Array
B. Stack
C. Tree
D. queue
Answer : D
35. When determining the efficiency of algorithm the time factor is measured by
A. Counting microseconds
B. Counting the number of key operations
C. Counting the number of statements
D. Counting the kilobytes of algorithm
Answer : B
36. Stack is also called as
A. Last in first out
B. First in last out
C. Last in last out
D. First in first out
Answer : A
37. The number of possible ordered trees with three nodes A,B,C is?
A. 16
B. 12
C. 6
D. 10
Answer : B
38. Which if the following is/are the levels of implementation of data structure
A. Application level
B. Abstract level
C. Implementation level
D. All of the above
Answer : D
39. For an algorithm the complexity of the average case is
A. Much more complicated to analyze than that of worst case
B. Much more simpler to analyze than that of worst case
C. Sometimes more complicated and some other times simpler than that of worst case
D. None or above
Answer : A
40. Which of the following is non-liner data structure?
A. List
B. Stacks
C. Trees
D. Strings
Answer : C
41. The complexity of merge sort algorithm is
A. O(n)
B. O(log n)
C. O(n2)
D. O(n log n)
Answer : D
42. The memory address of the first element of an array is called
A. floor address
B. foundation address
C. first address
D. base address
Answer : B
43. Which of the following data structure store the homogeneous data elements?
A. Arrays
B. Records
C. Pointers
D. None
Answer : A
44. Which of the following case does not exist in complexity theory
A. Best case
B. Null case
C. Worst case
D. Average case
Answer : B
45. Two main measures for the efficiency of an algorithm are
A. Processor and memory
B. Complexity and capacity
C. Time and space
D. Data and space
Answer : C
46. Each data item in a record may be a group item composed of sub-items; those items which are indecomposable are called
A. elementary items
B. atoms
C. scalars
D. all of above
Answer : D
47. Which of the following is not a limitation of binary search algorithm?
A. must use a sorted array
B. requirement of sorted array is expensive when a lot of insertion and deletions are needed
C. there must be a mechanism to access middle element directly
D. binary search algorithm is not efficient when the data elements are more than 1000.
Answer : D
48. Which of the following name does not relate to stacks?
A. FIFO lists
B. LIFO list
C. Piles
D. Push-down lists
Answer : A
49. The initial configuration of the queue is a,b,c,d (a is the front end). To get the configuration d,c,b,a one needs a minimum of ?
A. 3 additions and 2 deletions
B. 2 deletions and 3 additions
C. 3 deletions and 4 additions
D. 3 deletions and 3 additions
Answer : D
50. Which of the following data structure is linear data structure?
A. Trees
B. Graphs
C. Arrays
D. None of above
Answer : C

Sharing is caring