Data forms an integral part of the computer language. In the computer language, the data could be anything like a numeric value, alphabetical value or a special character.
There are many types of data structure in various computer languages like C++, python, Java etc. Data structures like Hash Tables, Trees, Graphs etc are some of the type of data structures easily found in the computer languages.
MCQs (Multiple Choice Questions)
Q1 Provide the format for the representation of string in the memory in C language?
- Represented as an array of characters
- Can be represented as an object of some type of class
- Could be the same just as the other primitive data types
- Could be the Linked list of Characters
Answer: 1
The correct way for the representation of string in the memory in C language is represented as an Array of Characters.
Q2 Can you tell the advantage of using the array data structure among the following statements?
- The entities of mixed type of data types could be easily stored
- The access to the elements present in the array is a little easy
- Always the index number of the first element present starts from the number 1
- None of the above
Ans: 2 is the correct answer because, in an array, the elements present are stored in the block of memory. So it becomes easy to access it.
Q3 Which among the following is the queue data structure’s applications?
- When among the many or multiple users, a resource is shared.
- Balancing of the load.
- When the transferring of the data is asynchronous
- All of the above
Answer: 4 All the above as all these features are the applications of queue type of data structure
Q4 Name the type of data structure among the following that could be used to implement queues?
- Linked List type of data structure
- Arrays type of data structure
- Stack type of data structure
- All of the above following type
Answer: 4 As all the above following options could be used for the implementation of queues, option 4 is the right answer.
Q5 Among the following options, which of the following type of data structure is used in recursion?
- Queues type of data structure
- Array type of data structures
- List type of data structures
- Stack type of data structures
Answer: 4 In recursion, the type of data structure that finds its use is the Stack type of data structure.
Q6 The data structure that allows the insertion, as well as the deletion from both the ends, are:
- String type of data structure
- Queue type of data structure
- Stack type of data structure
- Dequeue type of data structure
Answer: 4 The type of data structure that allows insertion, as well as the deletion from both the ends, is the dequeue type of data structure.
Q7 For getting best time complexity in the worst case scenario, which type of sorting algorithms are used?
- Bubble sort of algorithm
- Selection sort of algorithm
- Quick sort of algorithm
- Merge sort of algorithm
Answer: 4 because among the following, merge sort of algorithm is used.
Q8 For processing queries on trees, which of the following algorithm is ised and found to be highly useful?
- Centroid type of algorithm
- Heavy Light Decomposition type of algorithm
- Both A and B are correct
- None of the above
For handling the queries on trees, both centroid as well as the heavy light decomposition type of algorithm are used.
Q9 In C++ language, the maps implemented use which kind of a data structure?
- Hash tables type of structure
- Red Black tree type of data structure
- Data structure such as AVL trees
- Binary Search trees type of structure
Answer: 2 For the implementation of maps in C++ language, Red Black Tree type of data structure is used
Q 10 Among the following, what all could be done on Linkedlist?
- For the binary trees to be implemented
- For the stacks and queues to be implemented
- Dynamic Array
- All of the above
Answer: 4 For implementing the type of data structure that can be helpful is simulating Dynamic Array
Q11 For implementing the recursive algorithm which type of data structure is used?
- List type of data structure
- Array type of data structure
- Stack type of data structure
- Queue type of data structure
Answer: 3 The stack type of data structure is used for implementing the recursive algorithm
Q12 What do one mean by bit array term?
- It is a data structure used for the representation of the arrays
- It is a data structure that stores bits
- It is a type of array in which most of the elements possess the same value
- It is a type of array in which the elements are present in discontinuous location
Answer: 2 It is a data structure that helps in storing in bits
Q13. Among the following, which is not an advantage of using a bit array?
- The exploit bit level parallelism type
- Maximum use of data cache feature
- It is helpful for storing and manipulating in the register set for a longer period of time
- For the access of individual elements making it easier
Answer: 4 Bit array makes it easier for handling individual elements as it is really complicated to handle them at once
Q14 To toggle a particular bit, which of the following bitwise operator would be used?
- OR operator
- AND operator
- XOR operator
- NOT operator
Answer: 3 XOR operator is used to toggle a particular bit in the bitwise operations
Q15 To set a particular bit to 1, which of the following bitwise operation can be used in it?
- OR operator
- AND operator
- XOR operator
- NOR operator
Answer: 1 because OR operator is used in the bitwise operations to set a particular bit to 1
Q16 who is responsible for coining the term Sparse Matrix?
- Arthur Cayley
- James Sylvester
- Harry Markowitz
- Chris Messines
Answer: 3 It was coined by Harry Markowitz whereas Arthur Cayley is responsible for developing the algebraic aspect of matrix.
Ques 17 Which among the following matrix has lots of elements as zero?
- Unit matrix type
- Identity matrix type
- Zero matrix type
- Sparse matrix type
Answer: 4 The matrix that has lots of elements as zero is sparse matrix
Q18 What can be the relation between sparsity and density in a matrix?
- Sparsity = 1- Density
- Sparsity = Density + 1
- Sparsity = Total number of elements * density
- Sparsity = Density divided by total number of elements
Answer: 1 The correct relation is Sparsity = 1- Density
Q19 For the multiplication of matrix, which among the following properties is not true?
- Associative property
- Distributive property
- Commutative property
- Additive property.
Answer: 3 The commutative property does not hold true for matrix.
Q20 Which is an important advantage of matrices?
- Plotting of graph
- Internal Complexity
- Less efficiency of space
- None of the above
Answer: 1 The graph plotting property is an important advantage of matrices.