wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

MIDTERM

Total questions: 25

Worksheet time: 7mins

Name
Class
Date
1.

A fundamental in data structure in C++ that allows you to store a collection of an elements of the same type

a)

link list

b)

array

c)

function

d)

parameter

2.

It contains a collection of statements that define what the functions does.

a)

Function Body

b)

array

c)

link list

d)

none of the following

3.

A function in C++ that defined with a name, parameter, and no return types

a)

True

b)

False

4.

A function in C++ that breaking down complex problem

a)

modularity

b)

array

c)

link list

d)

functions

5.

It is enable you to directly access and modify the data stores at specific memory location

a)

array

b)

function

c)

pointers

d)

linked lisr

6.

What is the purpose of arrays in programming?

a)

grouping data

b)

storing data

c)

data coherence

d)

data encrytion

7.

How are array elements usually accessed ?

a)

using indices

b)

using keys

c)

using pointer

d)

using address

8.

What advantage do arrays offer in terms of data organization?

a)

facilitating the organization of related data items interms into a coherent structure

b)

Enabling efficient data manipulation

c)

Supporting diverse data types

d)

Allowing direct access to elements via endices

9.

What is a pointer?

a)

A variable that store the memory address of another variable

b)

A variable that shows the values of another variable

c)

A function that returns the address of a variable

d)

An operator that access the value of a variable

10.

Which operator is used to declare a pointer varaible?

a)

&

b)

@

c)

*

d)

#

11.

What does the following code do?

int num = 10

int *ptr =#

print ( "%",* ptr);

a)

Print the address of num

b)

Print the value of num

c)

Print the value of ptr

d)

Print the address the ptr

12.

What is the type of a pointer that points to an integer variable?

a)

int

b)

int *

c)

*int

d)

&INT

13.

What is the index range for the first and last element of an array?

a)

0 to arraysize-0

b)

1 to arraySize

c)

arraySize to 0

d)

0 to arraySize

14.

What is the importance of arrays in loops and iterations?

a)

Facilitating , iteration and operation execution

b)

Enabling dynamic memory allocation

c)

Efficient data oragnization

d)

Supporting diverse data tyoes

15.

Why are arrays fundamental in algorithm , data structures and programming practice?

a)

They facilitate efficient data storage and manipulation

b)

They support dynamic memory allocation

c)

They enhance data organization

d)

they handle diverse data types

16.

This is like a place holder when a function is invoked

a)

parameter

b)

array

c)

queue

d)

none of the above

17.

What is a node in data structure ?

a)

function

b)

A fundamental building block of data structure

c)

a type of algorithm

d)

a database system

18.

What do nodes typicallly contain in a linked list data structure?

a)

only data

b)

only links

c)

data and links

d)

data and algorithm

19.

What operation involves adding a new node to a data structure?

a)

deletion

b)

traversal

c)

searching

d)

insertion

20.

What is the role of "next" in a typical node structure in a linked list?

a)

store data

b)

Points to the next node

c)

points to the previous nodes

d)

none of the above

21.

How is node deletion typically handled in a linked list?

a)

by adding a new node

b)

by adjusting the necessary links

c)

by traversing the next node

d)

duplicating the node

22.

What is the primary purpose of nodes in a tree data structure?

a)

to perform sorting algorithm

b)

to establish parent -child relationship

c)

to connect to database

d)

to store operations

23.

In the context of graph data structure what do nodes represent?

a)

Edges

b)

Functions

c)

Vertices

d)

algorithms

24.

In the linked-list , what does the "head" node refer to?

a)

the last node

b)

the middle node

c)

the first node

d)

a ramdom node

25.

A data structure affects the designing of both structural and functional aspects of program

a)

True

b)

false