wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Structures and Algorithms Quiz #1

Total questions: 35

Worksheet time: 12mins

Name
Class
Date
1.

What is a data structure?

a)

A programming language

b)

A way to store and organize data efficiently

c)

A type of algorithm

d)

A computer hardware component

2.

Which of the following best defines an algorithm?

a)

A data storage method

b)

A programming syntax

c)

A step-by-step procedure to solve a problem

d)

A variable declaration

3.

Which factor is NOT used to measure algorithm efficiency?

a)

Time complexity

b)

Space complexity

c)

Code readability

d)

Input size

4.

Which data structure stores elements in a linear sequence?

a)

Tree

b)

Graph

c)

Linear data structure

d)

Hash table

5.

Which is an example of a non-linear data structure?

a)

Array

b)

Linked list

c)

Stack

d)

Tree

6.

Which of the following is NOT a basic data structure?

a)

Array

b)

Linked List

c)

Compiler

d)

Stack

7.

What is the primary goal of algorithms?

a)

Write long code

b)

Increase memory usage

c)

Solve problems efficiently

d)

Reduce hardware usage

8.

Big-O notation is used to describe:

a)

Code syntax

b)

Algorithm efficiency

c)

Variable scope

d)

Memory address

9.

What does Big-O measure?

a)

Best case only

b)

Average case only

c)

Hardware speed

d)

Worst-case performance

10.

An array stores elements in:

a)

Random memory

b)

Non-contiguous memory

c)

Contiguous memory

d)

Stack memory only

11.

Array index starts from:

a)

0

b)

1

c)

-1

d)

Depends on OS

12.

Which is NOT an array operation?

a)

Traversal

b)

Insertion

c)

Rotation

d)

Deletion

13.

Which is a limitation of arrays?

a)

Fast access

b)

Fixed size

c)

Easy traversal

d)

Simple structure

14.

A linked list consists of:

a)

Index and value

b)

Data only

c)

Data and pointer

d)

Pointer only

15.

Which memory allocation is used in linked lists?

a)

Contiguous

b)

Static

c)

Fixed

d)

Dynamic

16.

Main advantage of linked list over array?

a)

Faster access

b)

Dynamic size

c)

Less memory

d)

Indexing

17.

What is the first node called?

a)

Tail

b)

Root

c)

Head

d)

End

18.

Last node points to what in singly linked list?

a)

NULL

b)

Itself

c)

Head

d)

Random node

19.

Circular linked list last node points to:

a)

NULL

b)

Head

c)

Tail

d)

Middle

20.

Linked list is best for:

a)

Fixed size data

b)

Dynamic memory

c)

Index-based access

d)

Random access

21.

What happens if head pointer is NULL?

a)

List is empty

b)

List is full

c)

Error

d)

Loop exists

22.

Which linked list connects last node to first?

a)

Single

b)

Doublely

c)

Circular

d)

Linear

23.

Circular linked list avoids:

a)

Looping

b)

NULL pointer

c)

Traversal

d)

Pointers

24.

inked list does NOT support:

a)

Dynamic size

b)

Easy insertion

c)

Traversal

d)

Random access

25.

Which pointer stores address of first node?

a)

Tail

b)

Head

c)

Current

d)

Next

26.

All elements in an array must be of:

a)

Same data type

b)

Different data types

c)

Mixed data types

d)

Object type only

27.

What happens when an element is inserted at the beginning of an array?

a)

No change

b)

Elements shift right

c)

Elements shift left

d)

Array size decreases

28.

Array elements are accessed using:

a)

Pointers

b)

Keys

c)

Links

d)

Index

29.

Memory for arrays is allocated:

a)

Randomly

b)

Contiguously

c)

Dynamically only

d)

In stack only

30.

Which array index is invalid for an array of size 5?

a)

0

b)

2

c)

4

d)

5

31.

Which condition is used to stop traversal in circular linked list?

a)

Current == NULL

b)

Current == head

c)

Current == tail

d)

Current == first node again

32.

In circular linked list, head node is:

a)

Always NULL

b)

Optional

c)

Not required

d)

Accessible from last node

33.

If head pointer is NULL, the list is:

a)

Empty

b)

Full

c)

Invalid

d)

Circular

34.

Which data structure is faster for traversal?

a)

Linked list

b)

Array

c)

Both same

d)

Depends on data

35.

Which data structure is better for frequent access operations?

a)

Linked list

b)

Array

c)

Both same

d)

None