{
  "translations": {
    "en": {
      "sc1": "Consider inserting a record with key value 30 in this tree. We call the inserthelp method with a pointer to the BST root (the node with value 37).",
      "sc2": "Check what rt is pointing to. It is not null.",
      "sc3": "Check the value at the root. We find that it is greater than what we are looking for.",
      "sc4": "So we want to visit the left child.",
      "sc5": "We make a recursive call with the left child as the new rt.",
      "sc7": "Check the value at the root. We find that it is less than what we are looking for.",
      "sc8": "So we want to visit the right child.",
      "sc9": "We make a recursive call with the right child as the new rt.",
      "sc14": "Check what rt is pointing to. This time it is null! So make a new node.",
      "sc15": "At this point we have hit the base case on the recursive process. So now we will return out of the current instance of inserthelp.",
      "sc16": "Unwinding the recursion one level brings us the node with value 32, which is to the parent of the new node that we just created. We now re-assign its left pointer to point to the return value from the call to inserthelp (the new node that we had just created).",
      "sc17": "Unwinding the recursion another level brings us the node with value 24. We now re-assign its right pointer to point to the return value from the call to inserthelp.",
      "sc17a": "Now return the value of rt (root of the updated subtree).",
      "sc18": "Unwinding the recursion another level brings us the node with value 37. We now re-assign its right pointer to point to the return value from the call to inserthelp.",
      "sc19": "Finally we return from initial call to inserthelp, returning a pointer to the node with value 37 (the root of the original tree). We now re-assign the BST's root pointer."
    }
  },
  "code": {
    "java": [{
      "url": "../../../SourceCode/Java/Binary/BST.java",
      "lineNumbers": false,
      "startAfter": "/* *** ODSATag: inserthelp *** */",
      "endBefore": "/* *** ODSAendTag: inserthelp *** */",
      "tags": {
        "sig": 1,
        "checknull": 2,
        "compare": 3,
        "visitleft": 4,
        "visitright": 6,
        "returnrt": 7,
        "end": 8
      }
    }],
    "java_generic": [{
      "url": "../../../SourceCode/Java_Generic/Binary/BST.java",
      "lineNumbers": false,
      "startAfter": "/* *** ODSATag: inserthelp *** */",
      "endBefore": "/* *** ODSAendTag: inserthelp *** */",
      "tags": {
        "sig": 1,
        "checknull": 2,
        "compare": 3,
        "visitleft": 4,
        "visitright": 6,
        "return": 7,
        "end": 8
      }
    }]
  }
}
