{
  "translations" :{
    "en": {
      ".exerciseTitle": "AVL Tree Insertion",
      "av_Authors": "Kasper Hellström",
      ".instructLabel": "Instructions:",
      ".instructions": "Insert the values in the stack into the tree. Balance the tree at the correct node with the correct rotation when it becomes unbalanced.",
      "#buttonL": "Single Rotation Left",
      "#buttonR": "Single Rotation Right",
      "#buttonLR": "Double Rotation LR",
      "#buttonRL": "Double Rotation RL",
      "av_select_node": "Select an unbalanced node first!",
      "av_cannot_rotate": "Unable to perform this rotation on the selected node!",
      "av_ms_insert": "The value {val} is inserted into the tree.",
      "av_ms_unbalanced": "This node is now unbalanced.",
      "av_ms_rotation": "The rotation is performed on the unbalanced node in order to balance the tree."
    },
    "fi": {
      ".exerciseTitle": "Lisäys AVL-puuhun",
      "av_Authors": "Kasper Hellström",
      ".instructLabel": "Ohjeet:",
      ".instructions": "Lisää pinon avaimet AVL-puuhun ja tasapainota puu jokaisen operaation jälkeen, jos se on tarpeellista.",
      "#buttonL": "Rotaatio vasemmalle",
      "#buttonR": "Rotaatio oikealle",
      "#buttonLR": "LR-kaksoisrotaatio",
      "#buttonRL": "RL-kaksoisrotaatio",
      "av_select_node": "Valitse ensin epätasapainossa oleva solmu!",
      "av_cannot_rotate": "Tätä rotaatiota ei voi suorittaa valitulle solmulle!",
      "av_ms_insert": "Avain {val} lisätään puuhun.",
      "av_ms_unbalanced": "Tämä solmu on nyt epätasapainossa.",
      "av_ms_rotation": "Rotaatio suoritetaan epätasapainossa olevassa solmussa. Rotaation jälkeen puu on tasapainossa."
    }
  },
  "code": {
    "english": [
      "1 Do Binary Search Tree Insert (recursive algorithm)",
      "2 While the recursion returns, keep track of",
      "    node p,",
      "    p's child q and",
      "    p's grandchild r within the path from inserted node to p.",
      "3 If p is unbalanced, do one of the following rotations:",
      "    if (p.left == q) and (p.left.left == r), single rotation right in p;",
      "    if (p.right == q) and (p.right.right == r), single rotation left in p;",
      "    if (p.left == q) and (p.left.right == r), LR-double rotation in p; or",
      "    if (p.right == q) and (p.right.left == r), RL-double rotation in p."
    ],
    "finnish": [
      "1 Lisätään alkio (rekursiivisella algoritmilla) kuten binäärisessä hakupuussa",
      "2 Rekursion palatessa pidetään kirjaa",
      "    solmusta p,",
      "    p:n lapsesta q ja",
      "    p:n lapsenlapsesta r polulla lisätystä solmusta p:hen.",
      "3 Jos kohdataan epätasapainoinen solmu p tehdään jokin näistä rotaatioista:",
      "    jos (p.left == q) ja (p.left.left == r),",
      "        yksinkertainen rotaatio oikealle p:ssä;",
      "    jos (p.right == q) ja (p.right.right == r),",
      "        yksinkertainen rotaatio vasemmalle p:ssä;",
      "    jos (p.left == q) ja (p.left.right == r),",
      "        LR-kaksoisrotaatio p:ssä; tai",
      "    jos (p.right == q) ja (p.right.left == r),",
      "        RL-kaksoisrotaatio p:ssä."
    ]
  }
}
