concept reference in category algorithms

appears as: reference, reference, references, references
Algorithms and Data Structures in Action

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

In the pictures below, we will only show element’s priorities or, to see it in another way, we assume that elements and priorities are the same. This is just for the sake of space and clarity in diagrams, but it also highlights an important characteristic of heaps: in all their methods, we only need to access and move priorities. This can be important when elements are large objects: especially if they are so large that won’t fit in cache/memory or for any reason they are stored on disk, the concrete implementation can just store and access a reference to the elements and its priority.

Figure 3.5 The algorithm for performing a right rotation on a BST illustrated.
  • Each link in a tree will require 8 bytes (64 bits references), and each link in a trie will require 9 bytes (8 for the reference plus 1 for the character to which it’s associated).
  • Listing 6.11 method allKeys
    function allKeys(node, prefix)                        #1
      keys ← []                                    #2
      if node.keyNode then                            
        keys.insert(prefix)                            #3
      for c in node.children.keys() do                        #4
        keys ← keys + allKeys(node.children[c], prefix + c)            #5
      return keys                                #6