One solution would be to create a master list first, and then loop
over it, detecting which lists contain the value and indicating as
such.  Another would be to iterate over all three lists concurrently,
and at each iteration check and see which list (or lists) contains the
lowest unprocessed value, use that for the current row, and then mark
all instances of that value as processed.

The former is probably simpler to implement, but requires two passes,
an extra parallel data structure, and a whole bunch of
exists-in-collection checks.  As such, it's probably somewhat less
performant, but you'd have to do some tests to confirm that, as the
difference is probably trivial with small list sizes and counts.

cheers,
barneyb

On Mon, Sep 28, 2009 at 12:30 PM, Ian Skinner <h...@ilsweb.com> wrote:
>
> I have 6 alphabetical lists, CFML structure key lists but I don't think
> that matters.
>
> These 6 lists have many common keys with each having a few differences.
> I want to display a table with each list in its own column.  I would
> like it to sort such that common keys align together in the same row.
> But if no common key then skip that row for that list.  Maybe a diagram
> would clarify this.
>
> ListA ListB ListC
> 1     1     1
> 2           2
>      3     3
>      4
> 5     5
>
> The trouble is there is no master list to drive this from.  I just can
> not get my sleep deprived, aging mind to conceive of a way to create
> this display from six arbitrary lists.
>
>
> TIA
> Ian



-- 
Barney Boisvert
bboisv...@gmail.com
h

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326713
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to