Given
P={p_1, p_2, ..., p_m}, the set of products available at a local grocery store;
D={T_1, T_2, ..., T_N}, the set of transactions that were completed at this store in the past year, where each T_i (i in [1,N]) is a subset of P;
min_freq, a user-specified parameter (e.g., 5%).
A product is said to be frequent if it occurs in at least min_freq of the transactions in D. By the same token, a pair of products is said to be frequent if it occurs in at least min_freq of the transactions in D. Also, it's straightforward to prove the following claim: if a product is not frequent, none of the pairs that involve this product will be frequent. Use this claim to design an algorithm to find all the frequent products and frequent product pairs in D.
Represent your algorithm in pseudo code.

Given P={p_1, p_2, ..., p_m}, the set of products available at a local grocery store; D={T_1,...