Sample questions
Question 1Medium
Which of the following statements is not true?
- An array is a data structure containing a number of items of the same type
- An array is normally used to store two or more items of data
- The lower bound of an array can be declared as any unsigned value
- The elements of an array can be initialized when the array is declared
Answer: C. The lower bound of an array can be declared as any unsigned value
Explanation
As there is no any syntax to declare the lower bound of the array except the size of the array which can be declared.
Step-by-step solution
- The question asks for the statement that is NOT true.
- Options A, B and D are true: an array holds items of one type, is used for two or more items, and can be initialised when declared.
- Option C says the lower bound can be any unsigned value. In C-style arrays the lower bound is fixed at 0; only the size is declared.
- So the false statement is option C.
Why the other options are wrong
- A. True: an array holds items of one data type, so this is not the false statement.
- B. True: an array is normally used to store two or more items.
- D. True: array elements can be given values when the array is declared.
Tip: In 'which is NOT true' questions, mark each option true or false, then pick the false one.
Question 2Medium
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
Answer: C. the first data from the set to be stored
Explanation
Each array declaration need not give, implicitly or explicitly, the information about the first data from the set to be stored.
Step-by-step solution
- An array declaration gives the name, the data type and the index set (size or bounds).
- It does not need to give the first data value to be stored in the array.
- Marked answer: the first data from the set to be stored (option C).
Why the other options are wrong
- A. The array name is always part of a declaration.
- B. The data type is always part of a declaration.
- D. The index set (size or bounds) is part of a declaration.
Tip: A declaration gives name, type and index set; the stored values are not required.
Question 3Medium
The simplest type of data structure is ...
- Multidimensional array
- Linear array
- Two dimensional array
- Three dimensional array
Answer: B. Linear array
Explanation
A Linear Array is a list of finite number of n homogeneous data elements i.e.the elements of same data types. All arrays are linear data structures, as are all lists.
Arrays are linear because multiple elements are allocated in contiguous memory. If the array is a pointer array, only the pointer array need be contiguous; the data being pointed at can reside anywhere in memory, whether contiguous or not (you might use a separate pointer array to indirectly alter the order of elements in another array). Large and dynamic multi-dimensional arrays are typically allocated as a large array of pointers each of which points to a small array of data elements.
Step-by-step solution
- Linear array stores elements in a single row.
- All elements are accessed using one index.
- It is the most basic and simplest structure.
- Other arrays are built on top of linear arrays.
- The answer is Linear array.
Why the other options are wrong
- A. Multidimensional arrays are more complex than linear arrays.
- C. Two dimensional arrays require extra memory and logic.
- D. Three dimensional arrays are even more complex.
Tip: Remember: Linear array is the simplest data structure.
Question 4Medium
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
Answer: A. by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
Explanation
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.
Step-by-step solution
- Array elements are stored in consecutive memory cells.
- So the computer only needs to keep the address of the first element.
- The address of any other element is the first address plus its index times the element size: option A.
Why the other options are wrong
- B. Memory does not force serial storage; arrays are contiguous by design, not by hardware limit.
- C. Option B is wrong, so 'both of above' is wrong.
- D. Option A is correct, so 'none of above' is wrong.
Tip: Array address of element i = base address + i × element size.
Question 5Medium
Two dimensional arrays are also called?
- Matrix Array
- Table Array
- Both a and b
- None of the Above
Answer: C. Both a and b
Explanation
Two dimensional arrays are called as matrix array and table arrays because they contains rows and columns.
Step-by-step solution
- Two dimensional arrays have rows and columns.
- They are also known as matrix arrays.
- They are also known as table arrays.
- Matrix array and table array are both correct.
- So the answer is Both a and b.
Why the other options are wrong
- A. Matrix Array is one name but not the only name.
- B. Table Array is one name but not the only name.
- D. Both names are correct so this is wrong.
Question 6Medium
Which of the following data structure is linear data structure?
- Trees
- Graphs
- Arrays
- None of above
Answer: C. Arrays
Explanation
A Linear Array is a list of finite number of n homogeneous data elements i.e. the elements of same data types.
Step-by-step solution
- Arrays store elements in a sequence, one after another.
- Each element has a unique index, making it linear.
- Trees and Graphs have non-linear relationships between nodes.
- Linear data structures have elements arranged in a straight line.
- The correct answer is Arrays.
Why the other options are wrong
- A. Trees are hierarchical and non-linear.
- B. Graphs have multiple connections and are non-linear.
- D. Arrays are linear, so this option is incorrect.
Tip: Remember arrays are linear, while trees and graphs are non-linear.
Question 7Medium
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
Answer: A. for relatively permanent collections of data
Explanation
An array is a data structure that contains a group of elements. Typically these elements are all of the same data type, such as an integer or string.
Arrays are commonly used in computer programs to organize data so that a related set of values can be easily sorted or searched.
Step-by-step solution
- An array's elements sit side by side in memory with indexed access.
- Inserting or deleting in an array shifts other elements, which is costly.
- So arrays suit collections that stay relatively permanent: option A.
Why the other options are wrong
- B. Frequently changing size and contents suits lists or linked structures better than arrays.
- C. Option C needs arrays to fit both cases, but they fit only the stable case.
- D. Option A does describe arrays well, so none of the above is wrong.
Tip: Arrays suit fast indexed reads on stable data; for frequent inserts and deletes, choose another structure.
Question 8Medium
Arrays are best data structures......
- For relatively permanent collections of data.
- When the size of the structure and the data in it are constantly changing.
- For both of above situation
- For none of the above
Answer: A. For relatively permanent collections of data.
Explanation
arrays suit relatively permanent collections because their size is fixed
Step-by-step solution
- An array has a fixed size.
- Fixed size suits data whose size stays about the same.
- So arrays are best for relatively permanent collections.
- Option A is the correct answer.
Why the other options are wrong
- B. Changing size often is where arrays are weak; linked structures suit that.
- C. Arrays do not suit changing size, so both situations is wrong.
- D. Arrays do suit permanent collections, so none of the above is wrong.
Tip: Arrays suit fixed size, fast indexing data; linked lists suit frequent insertion and deletion.
Question 9Medium
The memory address of the first element of an array is called
- floor address
- Foundation Address
- first address
- base address
Answer: D. base address
Explanation
The memory address of the first element of an array is called base address.
Step-by-step solution
- Memory addresses are used to locate elements in an array.
- The first element's address is the starting point for accessing others.
- This starting point is known as the base address.
- Base address is the correct term for this concept.
- The answer is base address.
Why the other options are wrong
- A. Floor address is not a standard term in computer science.
- B. Foundation Address is not a recognized term in array terminology.
- C. First address is too vague and not the correct technical term.
Tip: Remember that 'base address' is the standard term used in array operations.
Question 10Medium
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
Answer: A. LOC(Array[5]=Base(Array)+w(5-lower bound), where w is the number of words per memory cell for the array
Explanation
The memory address of fifth element of an array can be calculated by the formula is:
LOC(Array[5]=Base(Array)+w(5-lower bound), where w is the number of words per memory cell for the array
Step-by-step solution
- For a one-dimensional array, the address of element i is Base + w × (i − lower bound).
- For element 5, this is LOC(Array[5]) = Base(Array) + w(5 − lower bound).
- Option A matches this formula exactly.
- So the correct answer is A.
Why the other options are wrong
- B. It uses Base(Array[5]), but the base is the address of the array, not of one element.
- C. It uses Base(Array[4]) and an upper bound, which is not the address formula.
- D. Option A is the correct formula, so 'None of above' is wrong.
Tip: LOC = Base + w × (index − lower bound) for a one-dimensional array.
Practise all 11 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →