Table and codes in C++, Java, and Matlab