public class Apriori{ public static void main (String args[]){ System.out.println ("Implementing Apriori Algorithm"); String trans[] = {"MONKEY", "DONKEY", "MAKE", "MUCKY", "COKIE"}; String items[] = new String [11]; int freq [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} ; int k = 0; for (int p = 0; p max){ max = freq[i]; maxVal1 = items[i]; } } max = -10; String maxVal2 = ""; for (int i = 0; i < freq.length; i ++) { if (!items[i].equals(maxVal1) && freq[i] > max){ max = freq[i]; maxVal2 = items[i]; } } System.out.println(); System.out.println ("Step 3:"); System.out.println ("The top two items that are the most transacted are " + maxVal1 + " and " + maxVal2); System.out.println(); max = -10; String contendors [] = new String [10]; k = 0; System.out.println ("Step 4:"); System.out.println ("The contendors for the third item that is transacted most with " + maxVal1 + " and " + maxVal2 + " are:"); for (int i = 0; i max){ max = sumCount; maxVal3 = temp; } } System.out.println(); System.out.println ("The set of three items that appear the most together are " + maxVal1 + maxVal2 + maxVal3) ; System.out.println(); } }