Question: Why is const iterator needed or required when iterators could do the same job as well?
One minute response: The one job that an iterator can't do is indicate that the value it references should not be changed. A const iterator, on the other hand, indicates that the value it references is constant.
Question: Why is that C++ doesn't have ltrim or rtrim functions as compared to other languages?
One minute response: I can't say for sure. C++ without strings is not a good language for handling text (C++ with strings is better but still not good). You could cobble up a creditable replacement using strings and find_first_not_of()
followed by an erase()
, but it's not as convenient as ltrim()
.
Question: No questions yet. Thank you.
One minute response: You're quite welcome.
Question: Why did you write compilers in grad school and we are merely traversing graphs?
One minute response: I took compiler courses, and writing compilers is a hobby of mine. Amusingly enough, your second assignment is compiler based: it's related to optimized placement of execution-tracing code for performance-related measurements.
Question: Like list has sort typed to the container list, are there implementation of algo's specific to the container or type of containers, say which use genericness & power of knowledge of type of container? What is the Java equivalent of the STL?
One minute response: Many of the STL algorithms use template specialization to implement more efficient versions based on container type. The Java Collection and Iterator library classes are the closest equivalent to the STL.
Question: Could you put list notes on the web? Thanks.
One minute response: Done.
This page last modified on 16 July 2003.