Common functions in the header file algorithm