Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. hirschIndex(Array of int citations)
  2.     k = 0
  3.     counter = 0
  4.     //array including all quoted publications
  5.     int a[citations.length]
  6.     MergeSort(citations, 1, citations.length)
  7.     for i = 1 to i = citations.length do
  8.         //if publication is different than the previous one, increase counter
  9.         if i - 1 > 1 AND citations[i] IS NOT citations[i-1] then
  10.             counter = counter + 1
  11.         end if
  12.         //increase the number of citations of the current publication
  13.         a[counter] = a[counter] +1         
  14.     end for
  15.     MergeSort(a, 1, a.length)
  16.     //find out hirschIndex
  17.     for i = a.length down to 1 do
  18.         //if the current publication is quoted more than k times, increase k
  19.         if a[i] > k then
  20.             k = k + 1
  21.         end if
  22.         //if k is now greater than a[i] return k, no following publication is quoted more often than a[i] (a was sorted before)
  23.         if k >= a[i] then
  24.             return k
  25.         end if
  26.     end for
  27.    
  28.     return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement