wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz 12: Templates, STL

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What does the T represent in the following statement?


template < class T >

a)

the name of the function template

b)

T stands for Template

c)

a generic data type that is used in a function template

d)

the int data type

2.

What does the word class indicate in the following statement?


template < class T >

a)

class is a key word that is used to precede the type parameter.

b)

It indicates that a class is being derived from an existing class named T.

c)

It indicates that a class named T is being derived from a class named template.

d)

A class named T will automatically be created by the compiler.

3.

A(n) __________ is like a pointer. It is used to access the individual data elements in a container.

a)

element access operator

b)

subscript indicator

c)

global data finder

d)

iterator

4.

The most important data structures in the STL are __________

a)

arrays and structures

b)

lists and groups

c)

containers and iterators

d)

templates and prototypes

5.

The algorithms provided by the STL are implemented as __________ and perform various operations on elements of containers.

a)

virtual functions

b)

function templates

c)

global variables

d)

private data members

6.

A(n) __________ is an abstract data type that stores and retrieves items in a last-in-first-out manner.

a)

array

b)

queue

c)

stack

d)

vector

7.

The __________ operation allows an item to be stored on a stack.

a)

Append

b)

Add

c)

Pop

d)

Push

8.

A dynamic stack has a __________ size and is implemented as a(n) __________.

a)

variable, linked list

b)

fixed, linked list

c)

variable, array

d)

fixed, array

9.

A queue is a data structure that stores and retrieves item in the __________ manner.

a)

last in, first out

b)

first in, last out

c)

first in, first out

d)

random

10.

The __________ operation allows an item to be removed from the stack.

a)

push

b)

pop

c)

delete

d)

remove