Image for post
Image for post

If we have two arrays of equal size and we need to find out the median of those arrays.

We have two arrays X and Y:

where :

X ={ x1 , x2}

Y = {y1 , y2}

After merging these two arrays X + Y structure will look like something:


Image for post
Image for post

Smart pointer is a class object that acts like a pointer but it has some additional features.

For ex: in below function:


Image for post
Image for post

A functor is a function object which implements a function call operator. This function call operator can be called in a way that looks like it’s a function.

A pretty basic example:


Image for post
Image for post

Multiple inheritance is a powerful and tricky tool to use in C++ programming language but sometimes it needs to be handled with care.

Virtual inheritance is used when we are dealing with multiple inheritance but want to prevent multiple instances of same class appearing in inheritance hierarchy.

Consider below example :

About

Nishi Tyagi

Software developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store