concept this figure in category algorithms

appears as: this figure
Algorithms and Data Structures in Action

This is an excerpt from Manning's book Algorithms and Data Structures in Action.

Then you might suggest to use ternary search trees, or their generalization: that, however, would make the rotation operations much more complicated, which means the code of the implementation would become terribly complicated and unclean (which likely also means slower!); moreover, we would have a harder time keeping the tree balanced, unless we use something like a 2-3 tree, but that’s already guaranteed to be a balanced tree.

Figure 7.2 With the introduction of cache, the web server, before issuing a call to the app server, checks if the results has already been computed, and in that case skips steps 3 to 6 in this figure. Note that cache can be added also for the single loaders, in case we allow partial results (f.i. if one of the external services is down). In theory added to the “data cruncher” instead of the web server (and delegate the interfacing with the data gatherer to the data cruncher, so that the web server directly calls the data cruncher only). Having cache on the web server (physically on the same machine), however, has several advantages.
Listing 10.13 The SsNode:: getEntriesCentroids method
function SsNode::getEntriesCentroids()                    #1
  if this.leaf then                                #2
    return this.points                            #3
  else
    return {child.centroid for child in this.children}            #4