273
94.3k

340+ Data Structure and Algorithms (DSA) Solved MCQs

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) , Electronics and Communication Engineering , Common Topics in Competitive and Entrance exams .

201.

_______ refers to situation where one wants to delete data form a data structure that is empty.

A. free storage
B. underflow
C. overflow
D. compaction
Answer» B. underflow
202.

________ is an organization that provides faster request and return time response.

A. stack
B. queue
C. buddy system
D. recursion
Answer» C. buddy system
203.

_______ attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes.

A. garbage collection
B. garbage compaction
C. buddy system
D. queue
Answer» B. garbage compaction
204.

A _______ list structure can be traversed in two directions-- in the forward direction from beginning of the list to end, or in the backward direction, from the end of the list to the beginning.

A. one way
B. linear array
C. two way
D. header
Answer» C. two way
205.

_________ header list combines the advantages of a two-way list and a circular header list.

A. one way
B. two way circular
C. two way
D. header
Answer» B. two way circular
206.

In linked list,a node contain

A. node,adrees field and data field
B. node number and data field
C. next adress field and information field
D. none of the above
Answer» C. next adress field and information field
207.

In linked list,the logical order of elements

A. is same as their physical arrangement
B. is not necessarily equivalent to their physical arrangement
C. is determined by their physical arrangement
D. none of the above
Answer» B. is not necessarily equivalent to their physical arrangement
208.

Null pointer is used to tell

A. end of linked list
B. empty pointer field of a structure
C. the linked list is empty
D. all of the above
Answer» D. all of the above
209.

List pointer variable in linked list contains address of the

A. following node in the first
B. current node in the first
C. first node in the first
D. none of the above
Answer» C. first node in the first
210.

Because of linear structure of linked list having linear ordering,there is similarity between linked list and array in

A. insertion of a node
B. deletion of a node
C. traversal of elements of list
D. none of the above
Answer» C. traversal of elements of list
211.

Searching of linked list requires linked list to be created

A. in stored order only
B. in any order
C. without underflow condition
D. none of the above
Answer» B. in any order
212.

A circular list can be used to represent

A. a stack
B. a queue
C. a tree
D. both a and b
Answer» D. both a and b
213.

To insert a node in a circular list at rear end it should be inserted at …...of the queue

A. front position
B. front-1position
C. rear position
D. rear-1 position
Answer» C. rear position
214.

In a circularly linked list organisation ,insertion of a record involves the modifications of

A. no pointer
B. 1 pointer
C. 2 pointer
D. 3 pointer
Answer» B. 1 pointer
215.

What is true about linked kist?

A. it is a linked structure,where each data gives the address of the next data
B. it is a dynamic data structure
C. it is a static data structure
D. both (a) and (b)
Answer» A. it is a linked structure,where each data gives the address of the next data
216.

A node of linked list contains_______

A. data field
B. a self referential pointer
C. both (a)and(b)
D. only b
Answer» C. both (a)and(b)
217.

Which nodes contains a null pointer in a linked list?

A. first node
B. middle node
C. last node
D. both (a) and (b)
Answer» C. last node
218.

Deletion of a node from an empty linked list will cause________

A. underflow
B. overflow
C. run time error
D. all of the above
Answer» A. underflow
219.

Insertion in a linked list requires modification of____pointers

A. 1
B. 2
C. 3
D. 4
Answer» B. 2
220.

Deletion in a linked list requeries modification of______pointers

A. 1
B. 2
C. 3
D. 4
Answer» A. 1
221.

Accessing time of nth node in a linked list is______

A. 0(n)
B. 0(1)
C. 0(n2)
D. 0(log n)
Answer» A. 0(n)
222.

An array is referenced by its name.Similarly,a linked list is referenced by____

A. address of the first node
B. address of the last node
C. both (a)and(b)
D. none of these
Answer» A. address of the first node
223.

Time required to search an element in a linked list is____

A. 0(n)
B. 0(log n)
C. 0(n2)
D. 0(n log n)
Answer» A. 0(n)
224.

Time required to search an element in a sorted linked list is______

A. 0(n)
B. 0(log n)
C. o(n2)
D. 0(n log n)
Answer» A. 0(n)
225.

Time required to delete a node with given address in a linked list is____

A. 0(n)
B. 0(log n)
C. 0(1)
D. 0(n log n)
Answer» A. 0(n)
226.

Select the set of instructions to insert a node pointed by q after a node pointed by p

A. q->next=p->next; p->next=q;
B. p->next=q; q->next=p->next
C. both (a)and(b)
D. none of these
Answer» A. q->next=p->next; p->next=q;
227.

select the set of operations to insert a node pointed by q at the beginning of the linked list

A. q->next=head; head=q;
B. head=q;q ->next=head;
C. both (a)and(b)
D. none of these
Answer» A. q->next=head; head=q;
228.

Select the set of operations to delete the first node from a linked list

A. p=head;head=head->next;free(p);
B. free(head)
C. head=head->next;p=head;free(p)
D. none of these
Answer» A. p=head;head=head->next;free(p);
229.

Select the correct looping condition for positioning apointer p on the second last in a linked list.Assume p=head,initially.

A. p->next->next!=null
B. p->next=null
C. p!=null
D. none of these
Answer» A. p->next->next!=null
230.

If address of the 8th element in a linked list of integers is1022,then address of the 9th element is

A. 1024
B. 1026
C. 1023
D. unknown
Answer» D. unknown
231.

The advantages of linked list over an array for representing a list is________

A. space used is less
B. deletion is easier
C. insertion is easier
D. both (a) and (b)
Answer» D. both (a) and (b)
232.

The address returned by malloc()is type casted because

A. malloc returns integers pointer
B. malloc returns void pointer
C. malloc returns an integer value
D. none of these
Answer» B. malloc returns void pointer
233.

Which function returns a void pointers?

A. malloc returns integers pointer
B. calloc
C. both (a)and(b)
D. none of these
Answer» C. both (a)and(b)
234.

Select the correct statement

A. free is used to release memory allocated by malloc
B. free is used to release memory allocated by calloc
C. both (a)and(b)
D. only(a)but not(b)
Answer» C. both (a)and(b)
235.

The____linked list can be processed in either direction.

A. singly
B. singly circular
C. doublyly
D. none of these
Answer» C. doublyly
236.

A polynominal in single variable should be handled using__

A. an array of structure
B. singly linked list
C. gll
D. both (a) and (b)
Answer» D. both (a) and (b)
237.

A node of doubly linked contains

A. pointer to predecessor
B. pointer to sucessor
C. both (a)and(b)
D. only(a)
Answer» C. both (a)and(b)
238.

Each node in a linear list contains an item called____which points to the next node in the list.

A. node
B. link
C. variable
D. null
Answer» B. link
239.

Which is not dynamic memory allocation function?

A. malloc returns integers pointer
B. calloc
C. alloc
D. free
Answer» C. alloc
240.

The function that allocates requested size of bytes and returns a pointer to the first byte of the allocated space is

A. realloc
B. malloc
C. free
D. none of these
Answer» B. malloc
241.

NULL link is not present in…

A. singly linked list
B. doubly linked list
C. circular linked list
D. none of these
Answer» C. circular linked list
242.

In a circular linked list

A. components are all linked together in some sequential manner.
B. there is no beginning and no end.
C. components are arranged hierarchically.
D. forward and backward traversal within the list is permitted.
Answer» B. there is no beginning and no end.
243.

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. none
Answer» A. linked list
244.

Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?

A. deleting a node whose location in given
B. searching of an unsorted list for a given item
C. inverting a node after the node with given location
D. traversing a list to process each node
Answer» A. deleting a node whose location in given
245.

Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head and tail pointer. Given the representation, which of the following operation can be implemented in O(1) time?
i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the last node of the linked lis

A. i and ii
B. i and iii
C. i,ii and iii
D. i,ii and iv
Answer» C. i,ii and iii
246.

Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time?

i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the last node of the linked list

A. i and ii
B. i and iii
C. i,ii and iii
D. i,ii and iv
Answer» B. i and iii
247.

Consider an implementation of unsorted doubly linked list. Suppose it has its representation with a head pointer and tail pointer. Given the representation, which of the following operation can be implemented in O(1) time?

i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the end node of the linked list

A. i and ii
B. i and iii
C. i,ii and iii
D. i,ii,iii and iv
Answer» D. i,ii,iii and iv
248.

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
249.

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)
250.

What would be the asymptotic time complexity to add an element in the linked list?

A. o(1)
B. o(n)
C. o(n2)
D. none
Answer» B. o(n)

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.