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...
The _________________________ provides convenient, one-tap or one-click access to frequently used commands.
Fill in the blank(s) with the appropriate word(s).
Computer Science & Information Technology
AV software on a computer must have its ____ files regularly updated by downloads from the Internet.
A. behavior B. program C. control D. signature
Computer Science & Information Technology