Data mining techniques is a popular research area. Association rule mining is the technique used to detect rules and patterns. One of the most well-known techniques is the Direct Hashing and Pruning (DHP) algorithm. This algorithm tries to find associations among the various data items in the date warehouse. In this paper, the attempt was made to optimize this algorithm further by changing its data structure to a red-black tree. The proposed algorithm was implemented in Java. The algorithm was applied on the real time customer transactional database of automobile industry. The complexity analysis of proposed algorithm was O(logn), which was significantly reduced as compared to the existing algorithms.