wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Structures Quiz

Total questions: 55

Worksheet time: 1hrs 18mins

Name
Class
Date
1.

What are the two essential cases in any recursive algorithm?

a)

Base case and Iterative case

b)

Base case and Recursive case

c)

Recursive case and Termination case

d)

Loop case and Exit case

2.

In recursion, the base case is:

a)

A simple occurrence that can be solved directly

b)

A complex problem that needs further recursion

c)

A case that terminates the computer

d)

A repeated loop that never stops

3.

What is an array?

a)

A collection of nodes pointing to each other

b)

A data structure that stores elements of the same type in a fixed size

c)

A database for storing numbers

d)

A dynamic list of elements

4.

In Java, array indices start from:

a)

1

b)

0

c)

-1

d)

Any number

5.

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

a)

O(1)

b)

O(n)

c)

O(log n)

d)

O(n²)

6.

A two-dimensional array can be visualized as:

a)

A stack

b)

A linked list

c)

A table with rows and columns

d)

A single-row list

7.

What is NOT a basic operation of an array?

a)

Traversing

b)

Inserting

c)

Searching

d)

Merging two arrays into a single node

8.

What is a major limitation of arrays?

a)

Dynamic size

b)

Fixed size

c)

No storage requirement

d)

Can only store strings

9.

How is a linked list different from an array?

a)

It uses pointers to link elements dynamically

b)

It stores elements in a contiguous memory location

c)

It does not allow deletion of elements

d)

It has a fixed size

10.

A node in a singly linked list contains:

a)

Only data

b)

Data and a reference to the next node

c)

Data and two references (next and previous)

d)

Only a reference to another node

11.

In a singly linked list, the first node is called:

a)

Tail

b)

Head

c)

Middle

d)

Node pointer

12.

In a doubly linked list, each node has:

a)

Only one reference to the next node

b)

Two references: one to the next node and one to the previous node

c)

No references

d)

Three references: previous, next, and middle

13.

What happens in a circular linked list?

a)

The last node links back to the first node

b)

Each node has multiple links

c)

The linked list is stored in an array

d)

It has only one node

14.

What is a key advantage of linked lists?

a)

Faster access time than arrays

b)

Fixed size allocation

c)

Easy insertion and deletion

d)

Uses less memory than arrays

15.

What is a major disadvantage of linked lists?

a)

Slow traversal compared to arrays

b)

Fixed size

c)

Inefficient insertion and deletion

d)

Cannot be used to store data

16.

What is the best way to access the 10th element in an array?

a)

Looping through all elements

b)

Using array[10]

c)

Searching sequentially

d)

Using a linked list

17.

Inserting an element at the head of a linked list requires:

a)

Updating the tail node

b)

Setting the new node’s next to reference the old head

c)

Shifting all elements

d)

Sorting the list first

18.

In a linked list, a sentinel node is used to:

a)

Store important data

b)

Simplify operations such as insertion

c)

Increase memory usage

d)

Create infinite loops

19.

The main application of linked lists in operating systems is:

a)

Managing process scheduling

b)

Storing large databases

c)

Running antivirus software

d)

Creating spreadsheets

20.

Which real-world application uses linked lists?

a)

Web browsers (back and forward navigation)

b)

Calculators

c)

Image compression

d)

Chess engines

21.

Which of the following is NOT an operation that can be performed on an array?

a)

Insertion

b)

Deletion

c)

Searching

d)

Multiplication

22.

In an array, what operation involves shifting elements after removing an item?

a)

Traversing

b)

Deletion

c)

Searching

d)

Sorting

23.

In an array, elements are accessed using:

a)

Pointers

b)

Indices

c)

Addresses

d)

Loops only

24.

Which of the following is an application of arrays?

a)

Storing records in a database

b)

Implementing web pages

c)

Running a music player

d)

Managing process scheduling

25.

Which operation is the fastest in an array?

a)

Searching

b)

Accessing an element using an index

c)

Deleting an element

d)

Inserting at the beginning

26.

What is an advantage of arrays?

a)

Dynamic size

b)

Fast access to elements using an index

c)

Easy deletion of elements

d)

No memory requirement

27.

What happens when you insert an element in the middle of an array?

a)

The array expands automatically

b)

All elements after the insertion point shift one position

c)

The array resets all values

d)

The operation fails

28.

Which of the following operations is difficult to perform efficiently in an array?

a)

Accessing an element

b)

Deleting an element from the middle

c)

Traversing

d)

Storing elements

29.

Which of the following data structures is preferred when inserting and deleting elements frequently?

a)

Array

b)

Linked List

c)

Stack

d)

Graph

30.

A linked list is best suited for which application?

a)

Implementing an operating system scheduler

b)

Storing a fixed number of student records

c)

Performing mathematical calculations

d)

Designing a calculator

31.

What makes a linked list better than an array in certain cases?

a)

It uses less memory

b)

It allows fast insertion and deletion of elements

c)

It does not require pointers

d)

It has a fixed size

32.

What is a common application of linked lists in web browsers?

a)

Managing browser history (back and forward navigation)

b)

Playing videos

c)

Running JavaScript code

d)

Storing cookies

33.

Which of the following is an example of a real-world application of a linked list?

a)

Image viewers for next/previous navigation

b)

Storing employee records in a fixed database

c)

Performing matrix multiplication

d)

Searching files on a hard drive

34.

What operation is faster in a linked list compared to an array?

a)

Inserting an element in the middle

b)

Accessing an element by index

c)

Sorting elements

d)

Performing arithmetic calculations

35.

Which linked list operation requires modifying only two links?

a)

Insertion at the end

b)

Deleting a node in the middle

c)

Traversing the list

d)

Searching for a value

36.

Every recursive algorithm must have at least one base case and one recursive case.

4 lines
37.

An array’s size can be changed dynamically.

4 lines
38.

In an array, accessing an element by its index is an O(1) operation.

4 lines
39.

A linked list is stored in contiguous memory like an array.

4 lines
40.

A singly linked list allows traversal in both directions.

4 lines
41.

A doubly linked list has two links per node: one to the next node and one to the previous node.

4 lines
42.

A circular linked list allows traversal from the last node back to the first node.

4 lines
43.

A linked list is better than an array when frequent insertions and deletions are required.

4 lines
44.

Arrays use more memory than linked lists due to additional pointer storage.

4 lines
45.

To access the 10th node in a linked list, all preceding nodes must be traversed.

4 lines
46.

Linked lists are used in music players for playlist navigation.

4 lines
47.

Linked lists are not used in web browsers.

4 lines
48.

Removing an element from a linked list is always O(1).

4 lines
49.

A linked list can dynamically increase in size as needed.

4 lines
50.

The first node in a linked list is called the tail.

4 lines
51.

The sentinel node in a linked list stores data.

4 lines
52.

A doubly linked list allows easier backward traversal compared to a singly linked list.

4 lines
53.

Stacks and queues can be implemented using linked lists.

4 lines
54.

Searching in a linked list is always faster than in an array.

4 lines
55.

Linked lists are used in operating systems for process scheduling.

4 lines