C++ Interview Questions and Answers
Prepare for your Interview today!
Mergesort always makes recursive calls to sort subarrays that are about half size of the original array, resulting in O(n log n) time.
Abstraction is of the process of hiding unwanted details from the user.
A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This allows algorithms in the base class to be replaced in the derived class, even if users don't know about the derived class.
An internal iterator is implemented with member functions of the class that has items to step through. .An external iterator is implemented as a separate class that can be "attach" to the object that has items to step through. .An external iterator has the advantage that many difference iterators can be active simultaneously on the same object.
A scope resolution operator (::), can be used to define the member functions of a class outside the class.
Most helpful rated by users: