179 179 {
180 180 for (int j=1;trannum[j]!=0;j++)
181 181 {
182 182 for (int k=0;TranL.r[j].item[k]!=0;k++)
183 183 {
184 184 if (L.item[i]==TranL.r[j].item[k])
185 185 {
186 186 c[i]++;
187 187 }
188 188 }
189 189 }
190 190 //计算F1支持度
191 191 if (c[i]>=minSupport*trannum[i+1])//两个整数相除得到整数
192 192 {
193 193 f[i]=c[i];
194 194 listInsertSq(L1,jj,L.item[i]);//L1
195 195 jj++;
196 196 }
197 197 }
198 198 printf_s("F1集合为:\n");
199 199 int temp1=0;
200 200 for (int i=0;i 201 201 { 202 202 printf_s("{%c}=%d ",L.item[i],f[i]); 203 203 if ((temp1+1)%3==0) 204 204 printf_s("\n"); 205 205 temp1++; 206 206 } 207 207 printf_s("\n"); 208 208 //排序TranL.r[j].item[k] 209 209 int t; 210 210 for (int i=1;i<=sn;i++)//每个事务 211 211 { 212 212 for (int j=0;j 213 213 { 214 214 if (TranL.r[i].item[j]>TranL.r[i].item[j+1]) 215 215 { 216 216 t=TranL.r[i].item[j]; 217 217 TranL.r[i].item[j]=TranL.r[i].item[j+1]; 218 218 TranL.r[i].item[j]=t; 219 219 } 220 220 } 221 221 } 222 222 //GenerateCandidates函数 223 223 int j1; 224 224 j1=L1.length; 225 225 //把L1->b2[i][] 226 226 for (int i=0;i 227 227 { 228 228 b2[i][0]=L1.item[i]; 229 229 } 230 230 int kk=0; 231 231 for (int i=0;i 232 232 { 233 233 generatedCandidate[kk]=L1.item[i]; 234 234 kk++; 235 235 for (int j=i+1;j 236 236 { 237 237 generatedCandidate[kk]=L1.item[i+1]; 238 238 if (generatedCandidate!=0) 239 239 { 240 240 char temp; 241 241 //排序 242 242 for (int i=0;generatedCandidate[i+1]!=0;i++) 243 243 { 244 244 if (generatedCandidate[i]>generatedCandidate[i+1]) 245 245 { 246 246 temp=generatedCandidate[i]; 247 247 generatedCandidate[i]=generatedCandidate[i+1