Compare between the similarity of rows
Compare between the similarity of rows
Hi All
I am trying to implement program that enable me to in a database and sort them based on the similarity degree of records.
The normal solution is based on pairwise comparison where you need to compare records against each other. This solution has very time complexity. Therefore, I am wondering if there is any other algorithms that you suggest to solving this problem in very fast and efficient way.
Thank you very much in advance and I look forward to hearing from you.
19 Feb 12, 4:33PM
When you say database, are you using MySQL or something similar. If so then the best solution by far is to investigate the sorting options within the SQL database.
If not, then by far the best, most general sort solution is Quick Sort or from the STL library: reference:sorting/sort
The type of sort mechanism you use largely depends on the type of information you have to sort and your available memory. If you have many items you might consider Heap sort.