Suppose you have a generic algorithm that requires forward iterators. Can I use it with a vector or a list even though these iterators are random access and bidirectional iterators respectively? Explain.

What will be an ideal response?


Yes. Iterators are an inclusive hierarchy. Random access iterators are bidirectional, and bidirectional iterators are forward iterators. So any iterators will work where a weaker iterator is specified.

Computer Science & Information Technology

You might also like to view...

Composition is sometimes referred to as a(n) ________.

a. is-a relationship b. has-a relationship c. many-to-one relationship d. one-to-many relationship

Computer Science & Information Technology

What does the registry store?

a) logs of previous user activity b) information about other computers on a LAN c) file system information d) configuration information

Computer Science & Information Technology

Describe a constellation.

What will be an ideal response?

Computer Science & Information Technology

Which of the following is NOT a method used to add fields to a query design grid?

A) Drag B) Double-click the title bar C) Click, Shift, Click D) Single-click field name

Computer Science & Information Technology