Explanation and implementation of common datastructures in C++