Contains Algorithms implemented in C++