Can you use the random_shuffle generic algorithm with a list container? What about a vector container? Why or why not?

What will be an ideal response?


The random_shuffle algorithm requires random access iterators. The list doesn’t have them but the vector does. So random_shuffle does not work with the list container but does with the vector.

Computer Science & Information Technology

You might also like to view...

Computers are ________, which means that they will do exactly the same thing every time if given the same input.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A(n) _______ database uses tables to organize information.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A browser hijacker can send mass, unsolicited email

Indicate whether the statement is true or false

Computer Science & Information Technology

Match the following terms to their meanings:

I. Range II. Table III. Database IV. Database table V. Linked table A. Structured to allow easy management and analysis B. A set of related data containing records arranged in rows and columns C. A file of related data containing objects D. Synchronizes data changes E. A group of adjacent or contiguous cells

Computer Science & Information Technology