I have a database table like this, what is the best way to sort this table. I wanted to sort this using B-Tree by the last name. Please write a basic C++ code.
id age last_name hometown
-- -- -- --
1 10 Johnson San Francisco, CA
2 27 Smith San Joe, CA
3 15 Rose Palo Alto, CA
4 64 Farmer Mill Valley, CA
5 55 Pauling San Francisco, CA
6 17 Smith Oakland, CA
... ... ... ...
100 49 Meyer Berkeley, CA
101 30 Wayne Monterey, CA
102 18 Schwartz San Francisco, CA
104 6 Johnson San Francisco, CA
... ... ... ..
10000 41 Fetterman Mountain View, CA
10001 25 Breyer Redwood City, CA