code: private static int[] freq(int[][] itemsets) {
          int[] f = new int[Math.max(itemsets) + 1];
          for (int[] itemset : itemsets) {
              for (int i : itemset) {
                  f[i]++;
              }
          }
          return f;
      }
docs: Returns the frequency of single items.
  @param itemsets the transaction database.
  @return the frequency of single items