The two different implementations can acheive the same results, but they belong to two different familes. One is strucutural and you'll find the C implementations like that (although it does work in C++ as well).
Where as classes are part of C++, which applies Object Oriented approach to solve the problems. In C++, the concept is like, you implement the algorithms in terms of class member functions and these can be accessed through the object (instance) of the class. (for static methods, you don't need the object of the class). This approach gives you good abstraction, encapsulations of data and many other benefits.
There is another pradigm, referred as Generic Programming, where the implementations are done through templates (like STL).