Bubble sort version,sort and count frequent