Q1. Which of the following bitwise operations will you use to toggle a particular bit?.
A. OR.
B. AND.
C. XOR.
D. NOT.
Answer= XOR
Q2. Which of the following is an advantage of bit array?.
A. Exploit bit level parallelism.
B. Maximal use of data cache.
C. Can be stored and manipulated in the register set for long periods of time.
D. All of the mentioned.
Answer= All of the mentioned
Q3. Identify the disadvantages of bit array..
A. Without compression, they might become sparse.
B. Accessing individual bits is expensive.
C. Compressing bit array to byte/word array, the machine also has to support byte/word addressing.
D. All of the mentioned.
Answer= All of the mentioned
Q4. What are some of the applications of bit arrays?.
A. Used by the Linux kernel.
B. For the allocation of memory pages.
C. Bloom filter.
D. All of the mentioned.
Answer= All of the mentioned
Q5. Which class in Java can be used to represent bit array?.
A. BitSet.
B. BitVector.
C. BitArray.
D. BitStream.
Answer= BitSet
Q6. What is a dynamic array?.
A. A variable size data structure.
B. An array which is created at runtime.
C. The memory to the array is allocated at runtime.
D. An array which is reallocated everytime whenever new elements have to be added.
Answer= A variable size data structure
Q7. What is meant by physical size in a dynamic array?.
A. The size allocated to elements.
B. The size extended to add new elements.
C. The size of the underlying array at the back-end.
D. The size visible to users.
Answer= The size of the underlying array at the back-end
Q8. The number of items used by the dynamic array contents is its __________.
A. Physical size.
B. Capacity.
C. Logical size.
D. Random size.
Answer= Logical size
Q9. How will you implement dynamic arrays in Java?.
A. Set.
B. Map.
C. HashMap.
D. List.
Answer= List
Q10. Which of the following is the correct syntax to declare an ArrayList in Java?.
A. ArrayList al = new ArrayList();.
B. ArrayList al = new ArrayList[];.
C. ArrayList al() = new ArrayList();.
D. ArrayList al[] = new ArrayList[];.
Answer= ArrayList al = new ArrayList();
Q11. In what type of dynamic array do you divide the array into two parts?.
A. Hashed Array Tree.
B. Geometric Array.
C. Bounded-size dynamic array.
D. None of the mentioned.
Answer= Bounded-size dynamic array
Q12. What are the advantages of dynamic arrays?.
A. Locality of reference.
B. Data cache utilization.
C. Random access.
D. All of the mentioned.
Answer= All of the mentioned
Q13. What is the time complexity for inserting/deleting at the beginning of the array?.
A. O(1).
B. O(n).
C. O(logn).
D. O(nlogn).
Answer= O(n)
Q14. What are parallel arrays?.
A. Arrays of the same size.
B. Arrays allocated one after the other.
C. Arrays of the same number of elements.
D. Arrays allocated dynamically.
Answer= Arrays of the same number of elements
Q15. What are the advantages of parallel arrays over the traditional arrays?.
A. When a language does not support records, parallel arrays can be used.
B. Increased locality of reference.
C. Ideal cache behavior.
D. All of the mentioned.
Answer= All of the mentioned
Q16. What are some of the disadvantages of parallel arrays?.
A. Poor locality of reference for non-sequential access.
B. Very little direct language support.
C. Expensive to shrink or grow.
D. All of the mentioned.
Answer= All of the mentioned
Q17. What is a sorted array?.
A. Arrays sorted in numerical order.
B. Arrays sorted in alphabetical order.
C. Elements of the array are placed at equally spaced addresses in the memory.
D. All of the mentioned.
Answer= All of the mentioned
Q18. To search for an element in a sorted array, which searching technique can be used?.
A. Linear Search.
B. Jump Search.
C. Binary Search.
D. Fibonacci Search.
Answer= Binary Search
Q19. What are some of the applications of sorted arrays?.
A. Commercial computing.
B. Priority Scheduling.
C. Discrete Mathematics.
D. All of the mentioned.
Answer= All of the mentioned
Q20. What is the worst case time complexity of inserting an element into the sorted array?.
A. O(nlogn).
B. O(logn).
C. O(n).
D. O(n2).
Answer= O(n)
Q21. What is a sparse array?.
A. Data structure for representing arrays of records.
B. Data structure that compactly stores bits.
C. An array in which most of the elements have the same value.
D. None of the mentioned.
Answer= An array in which most of the elements have the same value
Q22. When do you use a sparse array?.
A. When there are unique elements in the array.
B. When the array has more occurrence of zero elements.
C. When the data type of elements differ.
D. In all of the mentioned cases.
Answer= When the array has more occurrence of zero elements
Q23. What is the difference between a normal(naive) array and a sparse array?.
A. Sparse array can hold more elements than a normal array.
B. Sparse array is memory efficient.
C. Sparse array is dynamic.
D. A naive array is more efficient.
Answer= Sparse array is memory efficient