java - How to sort an ArrayList which contain more than 1000 different Strings on the basis of similairy to another given String -
i have arraylist contains 1000 strings. want sort list on basis of similarity given string outside. strings close string come in top. for eg. have string "beauty , beast". my arraylist contains string like: redwall beauty , beast 3 bluewall beautyqueen i beast of rome ii beauty , beast 1 beast beauty bluewall 2 beautyqueen ii beast of rome i beauty , beast 2 ... so after sorting arraylist, should like.. beauty , beast 1 beauty , beast 2 beauty , beast 3 beast beauty beautyqueen i beautyqueen ii beast of rome i beast of rome ii bluewall bluewall 2 redwall some thing this.. dont know how order going after beauty , beast 3.. should pick string have same string in beginning. i looking algorithm can me in implementing task in java. i have heard using levenstein distance, have no idea on how can used task. any pointers lot of help. i have created custom comparator per need , here's code s search string, matchi