Data Structures MCQs (Part-9)

What is the time complexity of accessing an element in a doubly linked list?

A O(1)
B O(n²)
C O(n)
D O(log n)

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

A It is a singly linked list with the last node pointing to the first node
B It is a doubly linked list with the first node pointing to the last node
C It does not require any additional memory
D It has a fixed size

What is the space complexity of an algorithm that uses a constant amount of extra memory regardless of the input size?

A O(n)
B O(1)
C O(log n)
D O(n²)

Which of the following data structures allows efficient insertions and deletions from both ends?

A Queue
B Stack
C Deque
D Binary Tree

In which scenario is a doubly linked list more advantageous than a singly linked list?

A When traversal only happens in one direction
B When insertion is required at both ends
C When space is a concern
D When searching for elements

Which of the following is true about space complexity in algorithms?

A It refers to the total time the algorithm takes to execute
B It refers to the amount of memory used by the algorithm
C It is always equal to time complexity
D It does not affect performance

What is the time complexity of inserting an element at the beginning of a doubly linked list?

A O(n)
B O(log n)
C O(n²)
D O(1)

Which operation is typically faster in a doubly linked list compared to a singly linked list?

A Insertion at the end
B Deletion at the end
C Traversal from head to tail
D Searching for a node

Which of the following best describes the space complexity of a recursive algorithm?

A It uses no extra space
B It uses memory proportional to the depth of the recursion
C It uses memory proportional to the size of the input
D It has constant space usage

What is the time complexity for searching an element in a circular linked list?

A O(1)
B O(n)
C O(log n)
D O(n²)

Which of the following is true about circular doubly linked lists?

A Nodes are linked in a linear fashion
B The last node points to the first node, and the first node points to the last node
C Only the head node has a reference to the tail node
D They can only be traversed in one direction

Which of the following is an advantage of using a circular linked list?

A Better memory utilization
B Easier to implement than regular linked lists
C Efficient searching
D Simplified traversal for cyclic structures

What is the space complexity of an algorithm that uses only a fixed number of variables, regardless of input size?

A O(n)
B O(log n)
C O(1)
D O(n²)

In which case is a circular doubly linked list particularly useful?

A For non sequential data storage
B When data needs to be accessed from both ends
C When memory needs to be minimized
D When elements are sorted

Which of the following data structures is ideal for implementing a circular queue?

A Linked List
B Array
C Stack
D Binary Tree