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

MCQs_on_Array_Data_Structure

The document contains multiple-choice questions (MCQs) focused on the array data structure, covering fundamental concepts such as definitions, indexing, time complexities, and specific types of arrays. Key topics include the characteristics of arrays, the efficiency of searching and sorting algorithms, and the properties of circular arrays. Each question is accompanied by the correct answer for quick reference.

Uploaded by

Ganesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

MCQs_on_Array_Data_Structure

The document contains multiple-choice questions (MCQs) focused on the array data structure, covering fundamental concepts such as definitions, indexing, time complexities, and specific types of arrays. Key topics include the characteristics of arrays, the efficiency of searching and sorting algorithms, and the properties of circular arrays. Each question is accompanied by the correct answer for quick reference.

Uploaded by

Ganesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

MCQs on Array Data Structure

1. 1. What is an array?
A) A collection of different data types
B) A collection of similar data types stored in contiguous memory
C) A collection of key-value pairs
D) None of the above
Answer: B

2. 2. What is the index of the first element in an array?


A) 1
B) -1
C) 0
D) Depends on the programming language
Answer: C

3. 3. What is the time complexity of accessing an element in an array by index?


A) O(1)
B) O(n)
C) O(log n)
D) O(n^2)
Answer: A

4. 4. A two-dimensional array is also known as a:


A) Stack
B) Matrix
C) Queue
D) Linked List
Answer: B

5. 5. What is a sparse array?


A) An array with all elements initialized to zero
B) An array in which most elements are non-zero
C) An array in which most elements are zero
D) None of the above
Answer: C

6. 6. What is the worst-case time complexity for searching an element in an unsorted array?
A) O(1)
B) O(n)
C) O(log n)
D) O(n log n)
Answer: B

7. 7. Which sorting algorithm works best for nearly sorted arrays?


A) Quick Sort
B) Merge Sort
C) Bubble Sort
D) Insertion Sort
Answer: D

8. 8. How do you find the largest element in an unsorted array?


A) Sort the array and take the last element
B) Traverse and compare elements one by one
C) Use binary search
D) Use a stack data structure
Answer: B

9. 9. What is the advantage of using a circular array over a normal array?


A) Reduces memory usage
B) Supports efficient queue operations
C) Avoids memory fragmentation
D) All of the above
Answer: D

10. 10. What is the time complexity of Kadanes algorithm used to find the maximum subarray sum?
A) O(n)
B) O(n log n)
C) O(n^2)
D) O(n^3)
Answer: A

You might also like