[Mono-list] Checking for identical items in an ArrayList

Gaurav Vaish gaurav.vaish@amsoft.net
Fri, 4 Oct 2002 09:28:43 +0530

> Hi all,
> I'm trying to implement a few methods in the System.Data namespace but I
> have the following question.
> When creating a DataTable and populating it, the values of each column
> are stored in an ArrayList.
> If after populating the DataTable I try to set one of the columns to be
> unique, the classes need to check if there is any repeated value in the
> ArrayList.

    Though not quite sure, but a binary sort followed by matching adjacent
elements. Sorting and searching on the basis of their hashcodes.

    If someone finds better, please do let me know. I will overhaul quite a
few of my programs. ;-)

Happy hacking,

> Since the DataTable can be storing considerable amounts of data, I would
> like to know what what be the best way, performance wise, of doing this.
> Thanks for your help.
> Luis