1. Consider this prototype for a template function:
template
void foo(Item x);
Which is the right way to call the foo function with an integer argument i?
a) foo( i );
b)foo( i );
c)foo( i );
d)foo( i );
e)foo( i );
2. Which of the following uses the balanced binary search tree to implement?
a)STL vector
b)STL map
c)STL priority queue
d)STL queue
Please explain. TKS

Respuesta :

1.

a. foo(1)

2.

b. STL map

It implements internal data structures using balanced binary search trees. STL Vector, Priority Queue, and Queue do not implement internal data structures using balanced binary search trees.

A balanced binary search tree is a data structure that allows fast insert, delete, and search operations. Maintain balance properties that keep the tree balanced and minimize tree height. This allows for faster search and insert operations compared to unbalanced trees.

STL maps must maintain keys in sorted order and support fast insert, delete, and search operations, so they implement an internal data structure using a balanced binary search tree.

Read more about this on brainly.com/question/13466570

#SPJ4

ACCESS MORE