wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Linear Data Structures Quiz

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

What is a linear data structure?

a)

A structure where elements are connected sequentially

b)

A structure where elements are connected hierarchically

c)

A structure where elements are connected randomly

d)

None of the above

2.
  1. Which sorting algorithm works by repeatedly selecting the smallest element?

a)

Selection Sort

b)

Insertion Sort

c)

Quick Sort

d)

Bubble Sort

3.

What is the time complexity of accessing an element in an array by index?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n^2)

4.

Which of the following operations is performed in O(1) time in a stack?

a)

Push

b)

Pop

c)

Both

d)

None

5.
  1. The number of passes required in Bubble Sort for an array of n elements is:

a)

n

b)

n - 1

c)

n / 2

d)

n + 1

6.

Which data structure works on the principle of LIFO?

a)

Stack

b)

Queue

c)

Array

d)

Linked List

7.

What is the time complexity of searching in a linked list?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n^2)

8.

Which of the following is not a linear data structure?

a)

Array

b)

Stack

c)

Graph

d)

Queue

9.

Which operation is not possible in a singly linked list?

a)

Traversing forward

b)

Traversing backward

c)

Insertion at the end

d)

Deletion from the start

10.

In a stack, what happens when an attempt is made to pop an element from an empty stack?

a)

Overflow

b)

Underflow

c)

Garbage value is returned

d)

None of the above

11.

Which operation is not performed in a queue?

a)

Enqueue

b)

Dequeue

c)

Peek

d)

Push

12.
  1. In a linked list, the header node:

a)

  1. Stores data only

b)

  1. Points to the next node only

c)

  1. Contains information like list length or metadata

d)

  1. Is always NULL

13.

Which data structure is more suitable for implementing recursion?

a)

Stack

b)

Queue

c)

Array

d)

Linked List

14.

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

a)

It can only be traversed in one direction.

b)

It can only be traversed in two directions.

c)

Both traversal directions are possible.

d)

None of the above.

15.

What is the time complexity of deleting the head node in a singly linked list?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n^2)

16.

In a queue, which operation is performed at the front?

a)

Enqueue

b)

Dequeue

c)

Peek

d)

None of the above

17.

What is the output of the following operations on a stack? Operations: push(10), push(20), pop(), push(30), pop()

a)

10 remains in the stack

b)

20 remains in the stack

c)

Stack is empty

d)

30 remains in the stack

18.

Which of the following applications uses a queue?

a)

Undo operation in text editors

b)

Resource scheduling in operating systems

c)

Depth-first search

d)

None of the above

19.

Which operation in a stack returns the top element without removing it?

a)

Pop

b)

Push

c)

Peek

d)

Enqueue

20.

What is the time complexity of insertion at the end of an array?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n^2)

21.

What is the minimum number of nodes required to create a circular linked list?

a)

0

b)

1

c)

2

d)

3

22.

Which of the following is a disadvantage of using an array to implement a stack?

a)

Fixed size

b)

Easy to implement

c)

Efficient access

d)

None of the above

23.

Which data structure is used to solve the 'Tower of Hanoi' problem?

a)

Queue

b)

Stack

c)

Array

d)

Linked List

24.

How is an element inserted in a priority queue?

a)

Based on priority

b)

At the front

c)

At the rear

d)

Randomly

25.

What is the condition for an empty queue in a circular queue?

a)

FRONT = REAR

b)

FRONT = -1

c)

REAR = size - 1

d)

Both a and b

26.

What happens when an element is added to a full queue?

a)

Overflow

b)

Underflow

c)

Garbage value is added

d)

None of the above

27.

Which of the following is true about arrays?

a)

They are fixed in size.

b)

They can grow dynamically.

c)

They are implemented as linked structures.

d)

None of the above.

28.

What is the maximum number of comparisons required to search for an element in a sorted array using binary search, where the array has n elements?

a)

n

b)

log n

c)

⌈log₂ n⌉

d)

29.

What is the amortized time complexity of the enqueue operation in a dynamic array implementation of a queue?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n²)

30.

Which of the following scenarios can lead to an infinite loop when traversing a circular linked list?

a)

The list is empty.

b)

There is no head pointer.

c)

There is no proper termination condition.

d)

The list contains duplicate values.

31.
  1. The time-space trade-off means:

a)

  1. Time increases with memory

b)

  1. More memory can reduce computation time

c)

  1. Time and space are unrelated

d)

  1. Reducing time always reduces memory

32.

What is the primary purpose of a stack data structure?

a)

To store elements in a linear order

b)

To implement priority scheduling

c)

To allow random access to elements

d)

To manage function calls and recursion

33.

Which of the following operations can be performed on a deque?

a)

Enqueue at both ends

b)

Dequeue from both ends

c)

Both

d)

None

34.

What is the time complexity of searching for an element in an unsorted array?

a)

O(n log n)

b)

O(1)

c)

O(log n)

d)

O(n)

35.

What is a sparse matrix?

a)

A matrix with most elements being non-zero

b)

A matrix where most elements are zero

c)

A matrix with an equal number of zero and non-zero elements

d)

A matrix with only one row or one column

36.

What is the primary disadvantage of using a linked list over an array?

a)

Fixed size

b)

Faster access time

c)

None of the above

d)

More memory overhead

37.

What is the time complexity of inserting an element at the end of a singly linked list?

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n²)

38.

Which of the following is a characteristic of a doubly linked list?

a)

It does not allow insertion at the beginning

b)

It uses less memory than a singly linked list

c)

It can be traversed in both directions

d)

Each node has only one pointer

39.

What is the primary function of the 'enqueue' operation in a queue?

a)

To remove an element from the front

b)

To add an element to the back

c)

To check the front element

d)

To clear the queue

40.
  1. The term “Asymptotic Notation” is used to:

a)

  1. Compare algorithms’ growth rates for large inputs

b)

  1. Measure the exact running time of an algorithm

c)

  1. Measure memory consumption

d)

  1. Represent constant time operations