Coding of few algos in C and C++