168
89.3k
Chapter:

20+ Linear Data Structures - List Solved MCQs

in Data Structures (DS)

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Computer Science Engineering (CSE) , Information Technology Engineering (IT) , Bachelor of Science in Computer Science FY (BSc CS) , Bachelor of Science in Information Technology FY (BSc IT) , Bachelor of Computer Applications (BCA) .

Chapters

Chapter: Linear Data Structures - List
1.

Which of these best describes an array?

A. A data structure that shows a hierarchical behaviour
B. Container of objects of similar types
C. Arrays are immutable once initialised
D. Array is not a data structure
Answer» B. Container of objects of similar types
2.

How do you initialize an array in C?

A. int arr[3] = (1,2,3);
B. int arr(3) = {1,2,3};
C. int arr[3] = {1,2,3};
D. int arr(3) = (1,2,3);
Answer» C. int arr[3] = {1,2,3};
3.

How do you instantiate an array in Java?

A. int arr[] = new int(3);
B. int arr[];
C. int arr[] = new int[3];
D. int arr() = new int(3);
Answer» C. int arr[] = new int[3];
4.

Which of the following is a correct way to declare a multidimensional array in Java?

A. int[] arr;
B. int arr[[]];
C. int[][]arr;
D. int[[]] arr;
Answer» C. int[][]arr;
5.

When does the ArrayIndexOutOfBoundsException occur?

A. Compile-time
B. Run-time
C. Not an error
D. Not an exception at all
Answer» B. Run-time
6.

Which of the following concepts make extensive use of arrays?

A. Binary trees
B. Scheduling of processes
C. Caching
D. Spatial locality
Answer» D. Spatial locality
7.

What are the advantages of arrays?

A. Objects of mixed data types can be stored
B. Elements in an array cannot be sorted
C. Index of first element of an array is 1
D. Easier to store elements of same data type
Answer» D. Easier to store elements of same data type
8.

What are the disadvantages of arrays?

A. Data structure like queue or stack cannot be implemented
B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
C. Index value of an array can be negative
D. Elements are sequentially accessed
Answer» B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
9.

Assuming int is of 4bytes, what is the size of int arr[15];?

A. 15
B. 19
C. 11
D. 60
Answer» D. 60
10.

In general, the index of the first element in an array is

A. 0
B. -1
C. 2
D. 1
Answer» A. 0
11.

Elements in an array are accessed

A. randomly
B. sequentially
C. exponentially
D. logarithmically
Answer» A. randomly
12.

Which of the following is not a disadvantage to the usage of array?

A. Fixed size
B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
C. Insertion based on position
D. Accessing elements at specified positions
Answer» D. Accessing elements at specified positions
13.

What is the time complexity of inserting at the end in dynamic arrays?

A. O(1)
B. O(n)
C. O(logn)
D. Either O(1) or O(n)
Answer» D. Either O(1) or O(n)
14.

Which of these is not an application of linked list?

A. To implement file systems
B. For separate chaining in hash-tables
C. To implement non-binary trees
D. Random Access of elements
Answer» D. Random Access of elements
15.

Which of the following is false about a doubly linked list?

A. We can navigate in both the directions
B. It requires more space than a singly linked list
C. The insertion and deletion of a node take a bit longer
D. Implementing a doubly linked list is easier than singly linked list
Answer» D. Implementing a doubly linked list is easier than singly linked list
16.

What is the worst case time complexity of inserting a node in a doubly linked list?

A. O(nlogn)
B. O(logn)
C. O(n)
D. O(1)
Answer» C. O(n)
17.

Which of the following application makes use of a circular linked list?

A. Undo operation in a text editor
B. Recursive function calls
C. Allocating CPU to resources
D. Implement Hash Tables
Answer» C. Allocating CPU to resources
18.

Which of the following is false about a circular linked list?

A. Every node has a successor
B. Time complexity of inserting a new node at the head of the list is O(1)
C. Time complexity for deleting the last node is O(n)
D. We can traverse the whole circular linked list by starting from any point
Answer» B. Time complexity of inserting a new node at the head of the list is O(1)
19.

A linear collection of data elements where the linear node is given by means of pointer is called?

A. Linked list
B. Node list
C. Primitive list
D. Unordered list
Answer» A. Linked list
20.

In linked list each node contain minimum of two fields. One field is data field to store the data second field is?

A. Pointer to character
B. Pointer to integer
C. Pointer to node
D. Node
Answer» C. Pointer to node
21.

What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?

A. O(1)
B. O(n)
C. θ(n)
D. θ(1)
Answer» C. θ(n)
22.

The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can be used?

A. Singly linked list
B. Doubly linked list
C. Circular doubly linked list
D. Array implementation of list
Answer» C. Circular doubly linked list
23.

Which of the following c code is used to create new node?

A. ptr = (NODE*)malloc(sizeof(NODE));
B. ptr = (NODE*)malloc(NODE);
C. ptr = (NODE*)malloc(sizeof(NODE*));
D. ptr = (NODE)malloc(sizeof(NODE));
Answer» A. ptr = (NODE*)malloc(sizeof(NODE));

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.