Array of strings

I have an array of strings containing the following elements:

good tame buys tame

I want to delete the repeated elements. Kindly provide me the approach and code for this.

Please reply soon, i am stuck for a long time

  1. Sort the elements.
  2. Now in a loop, remove duplicates by comparing the
    current character with previous character.
  3. Remove extra characters at the end of the resultant string
    But you ll loose the original order in thia

Use Hashing to keep the order
Algorithm:

  1. Initialize:
    str = “test string” ’ input string’
    ip_ind = 0 ’ index to keep track of location of next
    character in input string’
    res_ind = 0 ’ index to keep track of location of
    next character in the resultant string’
    bin_hash[0…255] = {0,0, ….} ’ Binary hash to see if character is
    already processed or not’
  2. Do following for each character *(str + ip_ind) in input string:
    (a) if bin_hash is not set for *(str + ip_ind) then
    // if program sees the character *(str + ip_ind) first time
    (i) Set bin_hash for *(str + ip_ind)
    (ii) Move *(str + ip_ind) to the resultant string.
    This is done in-place.
    (iii) res_ind++
    (b) ip_ind++
    ’ String obtained after this step is “te sringng” ’
    3: Remove extra characters at the end of the resultant string.
    ’ String obtained after this step is “te sring”’