Tagged: Programming

Factory pattern 0

Generic Factory in C++

A generic factory is a factory that can register any class type. It is very easy to write because we are allowed to use void pointers.

Usage:

As we are...

0

Maximum Subarray

Problem statement: Find the largest sum that is possible in an array. I.e., find the maximum sub-array. Solution: From the very first this problem looks complicated because of how it is framed....

C++Traits 0

C++ Traits

‘C++ Traits’ is an idiom that allows a great level of abstraction at compile time which is normally possible only by a combination of inheritance and composition. It allows an algorithm to...

0

Major bugs and workarounds

Imagine you have been given the job of installing AC vent ducts in a house. Great. So you begin your work, starting from the basement for some reason. And there in the...