{
  "translations": {
    "en": {
      "Slide 1": "Radixsort starts with an input array of $n$ keys with $k$ digits. Here we have $n=12$ and $k=2$",
      "Slide 2": "The outer loop will be executed $k$ times, one pass for each digit of key values",
      "Slide 3": "The first inner loop initializes the count array of size $r$, where $r$ is the base of the key values. This requires $r$ units of work",
      "Slide 4": "The Second inner loop counts the number of keys to be inserted in each bin. This requires a single pass over the input array that takes $n$ units of work",
      "Slide 5": "The third inner loop sets the values in the input array to their proper indices within the output array. This requires a single pass over the count array that takes $r$ units of work",
      "Slide 6": "The fourth loop assigns the keys from the input array to the bins within the output array according to the indices stored in the count array. This requires $n$ units of work",
      "Slide 7": "The last inner loop simply copies the keys from the output array back to the input array to be ready for the next pass of the outer loop. This requires $n$ units of work",
      "Slide 8": "Since we have $k=2$, the outer loop will be executed once more and all the previous steps are repeated for the leftmost digit (Tens digit)",
      "Slide 9": "At the end, since the outer loop is executed $k$ times and some of the inner loops execute $n$ times, while others are executed $r$ times, we have the total amount of work required is $\\theta(nk + rk)$",
      "Slide 10": "Because $r$ is the size of the base, it might be rather small and it can be treated as a constant. Thus, the total amount of work will be $\\theta(nk)$",
      "Slide 11": "In the case of unique key values, we have $k\\geq\\log_{r}{n}$, and thus the total running time of radixsort is $\\Omega(n\\log{n})$"
    }
  },
  "code": {
    "java": [{
      "url": "../../../SourceCode/Java/Sorting/RadixsortNoComments.java",
      "lineNumbers": false,
      "startAfter": "/* *** ODSATag: Radixsort *** */",
      "endBefore": "/* *** ODSAendTag: Radixsort *** */",
      "top": -10,
      "left": 420,
      "tags": {
        "loops": [5, 6, 8, 11, 13, 17],
        "loop1": 5,
        "loop2": 6,
        "loop3": 8,
        "loop4": 11,
        "loop5": 13,
        "loop6": 17
      }
    }]
  }
}
