# Re: Algo for intersection of two integer arrays?

*From*: "ziman137" <gangxu_csu@xxxxxxxxx>*Date*: 10 Mar 2006 12:45:49 -0800

Returns:

struct InterAB {

int indicesOfA [];

int valuesOfA [];

int indicesOfB [];

int valuesOfB [];

}

for your example:

InterAB.{

indicesOfA [] = {1, 3, 4, 5}

valuesOfA [] = {1, 2, 2, 7}

indicesOfB [] = {2, 3, 4, 6}

valuesOfB [] = {1, 2, 2, 7}

}

Hope this clarifies,

Gary

===========

Patricia Shanahan wrote:

ziman137 wrote:

Two arrays A & B, prototyped as int or char, pls return the common

integers or characters (both values & indices in A & B). Hope this

clarifies the confusion.

I still don't get it. Do the matches have to be at the same index, or is

it just that the index gets reported?

Here's an example:

A= 1, 5, 2, 2, 7

B= 0, 1, 2, 2, 3, 7

What should the result be?

Patricia

.

**Follow-Ups**:**Re: Algo for intersection of two integer arrays?***From:*Richard Harter

**Re: Algo for intersection of two integer arrays?***From:*Patricia Shanahan

**References**:**Algo for intersection of two integer arrays?***From:*ziman137

**Re: Algo for intersection of two integer arrays?***From:*Richard Harter

**Re: Algo for intersection of two integer arrays?***From:*ziman137

**Re: Algo for intersection of two integer arrays?***From:*Patricia Shanahan

- Prev by Date:
**Number of connected regions in an image, viewed as a graph** - Next by Date:
**Complexity of resolution** - Previous by thread:
**Re: Algo for intersection of two integer arrays?** - Next by thread:
**Re: Algo for intersection of two integer arrays?** - Index(es):

## Relevant Pages |