Ebeworld’s Weblog

Trying to create

Header files

1. It is best to include a.h file in a.cpp at the top to insure order of header files are irrelevant, which is very good design. There could be forward declarations.

A header file should be included only when a forward declaration would not do the job.
a.The size of the class’ objects is not needed.
b.The names or types of any of the class’ members are not needed.
c.The prototypes to or names of any of the class’ member functions are not needed
The header file should be so designed that the order of header file inclusion is not important.
The header file inclusion mechanism should be tolerant to duplicate header file inclusions.

March 29, 2011 Posted by | Algorithms, CPP, Uncategorized | Leave a Comment

An easy problem

My little brother just asked me about finding number of ways to divide numbers from 1 to N into two sets where the sums are equal. N<37. It feels like simple DP problem.

March 29, 2011 Posted by | Algorithms | Leave a Comment

   

Follow

Get every new post delivered to your Inbox.