I'm studying hash tables, and wrote the following to serve as a simple example.Does this properly demonstrate the basic concept of a hash table?The values are int from 0 to 9; the hashing algorithm is simply to square the number.#include <iostream>#include <cmath>const int KEY_RANGE=100;const int VALUE_RANGE=10;int main() {    int a[KEY_RANGE], hashKey;    for (int i=0; i<VALUE_RANGE; ++i) {        hashKey = (int)pow(i,2);        a[hashKey] = i;    }    std::cout << Hash keys: << std::endl;    for (int i=0; i<VALUE_RANGE; ++i) {        std::cout << (int)pow(i,2) << ' ';     }    std::cout << std::endl << std::endl;    std::cout << Hashed values: << std::endl;    for (int i=0; i<VALUE_RANGE; ++i) {        std::cout << a[(int)pow(i,2)] << ' ';     }    std::cout << std::endl;    return 0;}Output:pickledEgg> g++ -std=c++11 -g -Og -o squareHash squareHash.cpp  pickledEgg> ./squareHash  Hash keys: 0 1 4 9 16 25 36 49 64 81  Hashed values: 0 1 2 3 4 5 6 7 8 9
Simple example of a hash table using square as key
c++;hash table;hash map;hashcode