stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Arrays Flashcards | StudBud
Explore
/
Arrays
Arrays
22 terms
·
StudBud Administration
·
22 plays
Imported from external platform
Flashcards
22 cards
F
Practice quiz
P
Host live
L
Questions
22
Answers
1
What is the result of removing an element from the middle of an array?
The array automatically resizes to fill the gap.
The operation is not supported in standard arrays.
The array remains the same size, with a null or default value.
All elements to the right of the removed element are shifted left.
2
Which of the following best describes an array?
A data structure that allows for a dynamic size.
A collection of items stored at non-contiguous memory locations.
A collection of elements, identified by at least one array index or key.
A data structure that stores elements of different types.
3
What is the time complexity of the best case for a linear search algorithm?
O(1)
O(n^2)
O(log n)
O(n)
4
In the context of arrays, what does the term 'element' refer to?
The memory address of the array
An individual item stored in the array
A specific data type
The maximum capacity of the array
5
What is the index of the first element in a typical array in most programming languages?
Depends on the array length
1
-1
0
6
When sorting an array, what is generally not a consideration?
The data type of the elements
The number of elements in the array
The programming language used to sort
The initial order of elements
7
How can you best describe a 2D array?
A collection of variables
An array of arrays
An array with two elements
A list of integers
8
What is the most efficient way to increase the size of an array?
Use a linked list instead
Re-declare the array with the larger size
Copy elements to a larger array
Arrays cannot be resized
9
What is a potential downside of using arrays to store data?
Direct support for non-numeric indexing
High performance for access operations
Inability to store more than one type of data
Fixed size that might require copying to a larger array for expansion
10
What is typically required after an element is inserted into or removed from the middle of an array?
Re-sorting the array
Updating all element indices
Shifting subsequent elements to maintain order
Converting the array to a linked list
11
What does it mean if an array is described as 'homogeneous'?
It is sorted in ascending order
It contains elements of the same type
It has a fixed size that cannot change
It can only contain numeric values
12
Which of the following is true about array traversal?
It can only be done in reverse order.
It involves visiting each element of the array at least once.
It is the process of inserting elements into an array.
It requires the array to be sorted first.
13
Which operation is not directly supported by array data structures?
Searching for an element
Sorting the array
Inserting an element at the beginning
Accessing an element using its index
14
In an array of integers, what is the time complexity of accessing an element by its index?
O(1)
O(log n)
O(n)
O(n^2)
15
How does an array differ from a stack data structure?
An array cannot contain duplicate elements.
A stack can grow and shrink dynamically, whereas an array cannot.
An array allows random access to elements, while a stack does not.
B) and C) are correct.
16
Which of the following best explains dynamic arrays?
Arrays that can store elements of different data types
Arrays that can automatically resize to accommodate more elements
Arrays whose elements can change during runtime
Arrays that support dynamic programming techniques
17
When does an array typically require more memory than a singly linked list for the same number of elements?
Always, due to overhead
When elements are of different sizes
When there are no empty spaces in the array
When elements are added to the array
18
What happens if you try to access an array element with an index that exceeds the array's bounds?
A random element of the array is returned.
An error or exception is thrown.
The first element of the array is returned.
The array automatically expands to accommodate the new index.
19
What is true about multi-dimensional arrays?
They reduce the overall space usage compared to one-dimensional arrays.
They can only be two-dimensional.
They are arrays of arrays, allowing for matrix-like structures.
They offer faster access times than one-dimensional arrays.
20
In binary search algorithm, what is the type of the array it works on?
Unsorted
Partially sorted
Sorted in ascending order
Sorted in descending order
21
Which of the following algorithms is not a sorting algorithm?
Insertion sort
Selection sort
Binary search
Bubble sort
22
Which of the following is not a typical use case for arrays?
Implementing algorithms that require sequential access to elements
Storing data that needs frequent insert and delete at arbitrary positions
Implementing mathematical matrix operations
Storing elements that need to be accessed by their positional index