Hello
I am developing an addin for Groupwise in which I have a particular
problem. It is an issue of efficiency(not GW related)
I need to scan a collection of objects each with a long & painful ID
for example: 345SD3G098F.3F9SDNSD.SDF8S7DF98.SDFSDG
So my approach up to this point has been to create a sorted string array, do
an inital pass at the cost of O(N) - not too horrible for 1 pass.
However, at regular intervals, I need to scan this same collection for
changes. First I check the counts of each. If they are the same, I do
nothing. That helps alot, but when changes are made, my algorithm becomes:
For each MESSAGE in objMESSAGEBOX
If DoBinarySearch(myArray(), MESSAGE.ID) = NOT_FOUND then
RaiseEvent FoundNewMessage(MESSAGE )
end if
next
This yields about O(N * NlogN) if I remember my big O notation correctly.
Can anyone think of a more efficient way to implement this? I tried custom
Datatypes using a date-based sort, however, had little success.
Thanks in advance.
Andrew