Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public void occurrences(int [] a){
  2. quikSort(a);
  3. int count = 0;
  4. int temp = a[0];
  5. for (int i = 1 ; i < a.length ; i++){
  6. if (a[i] == temp )
  7. count++;
  8. else{
  9. System.out.println(temp + ":" + count + ",");
  10. temp = a[i];
  11. count = 1;
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement