Here's sample output from the example program given at the beginning of this chapter:
$ ./classhier
> add 1.1
Title: Languages
> add 1.1.1
Title: Compiled
> add 1.1.1.1 # Creates a couple of entries in the hierarchy
Title: C
> add 1.1.1.1 # The third lambda parameter to insert() returned false
Title: C++ # and added an entry to the existing node, not replacing it.
> add 1.1.2
Title: Interpreted
> add 1.1.2.1
Title: Javascript
> get 1.1.2.2
Found: 1.1.2
Interpreted
> get 1.1.2.1
Found: 1.1.2.1
Javascript
> get 1.1.2.1.1 # This node does not exist, found its closest parent.
Found: 1.1.2.1
Javascript
> del 1.1.1.2.1
Not found
> list
1.1
1.1.1
1.1.1.1
1.1.2
1.1.2.1
> del 1.1.2.1
Found: 1.1.2.1
Javascript
Delete? y
Removed
> list
1.1
1.1.1
1.1.1.1
1.1.2
> del 1.1.1
Found: 1.1.1
Compiled
Delete? y
Removed
> list # Note that the intermediate node, 1.1.1. does not have
1.1 # to exist.
1.1.1.1
1.1.2
> get 1.1.1
Found: 1.1 # Found closest parent node.
Languages
> get 1.1.1.1
Found: 1.1.1.1
C
C++
>