remove duplicates WITHOUT sorting [message #52572] |
Mon, 12 February 2007 09:04 |
rpertaub@gmail.com
Messages: 43 Registered: January 2007
|
Member |
|
|
Hello All,
I have an array of 2xn which is a list of coordinates (x,y positions)
and I need to remove any duplicates in this array. Since they are x,y
coordinates I cannot really sort the array, hence cannot use the Uniq
function. Is there another way of doing this?
My array is similar to:
[2 30
4 5
3 9
51 19
12 15
3 9
11 22
32 33
14 25]
As you see index 4,5 is same as index 10,11. How do i rewrite this
array without duplicates? Is there a general way of doing this, as
some of my coordinates (to make matters even more complicated) are not
exactly the same, but are close (3,9) and (3.5,9) - But I think I can
figure this out with some if...then statements. Not sure how to remove
them though. Any help is appreciated!
Thank you,
Radha
|
|
|