I am writing code for apriori algorithm in data mining my code takes arund 50 seconds to give output on a small dataset but i found a code on internet which gives output in just 2 seconds but i don't understand where am i losing time can someone explain why my code is taking too long.
Your code is doing a lot of repeated work deep inside nested loops. You're repeatedly creating StringTokenizer objects and asking them to tokenize the same string over and over again, and I'm pretty sure I saw other such things going on. (You posted a very large quantity of code with unhelpful variable names and my eyes glazed over when I tried to look at it carefully, but you're doing a lot of wasteful repetitive work there.)
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop