concept shape in category algorithms

This is an excerpt from Manning's book Algorithms and Data Structures in Action.
Obviously, however, the shape of the trees and the actual number of nodes also play a big role: in the example in figure 6.3 only a short prefix is shared among the keys. Turns out, tries are more efficient when holding keys with a large shared prefix: the example in figure 6.4 shows how the balance can be in favor of tries in these cases; as you can see, in the example of figure 6.4 most trie nodes are black (key nodes) and when the ratio of key nodes versus intermediate nodes is higher, intuitively it means that the efficiency of the trie is also higher, because most nodes contribute to storing words that, in a BST, would require a full string (and BST node) to be stored.
Figure 17.1 Gradient descent versus local random optimization. While for gradient descent steps are proportional to the curve’s steepness, the random steps are… just random (within a reasonable radius). That’s why it’s easier to the random algorithm to step over a local minimum, or even get out of it (technically both are possible for gradient descent as well, as we have seen in chapter 16, depending on the learning rate and shape of the cost function).
![]()