Obviously, I'm a fairly novice programmer. Just looking for some help pointing me in the right direction.

09-13-2011, 11:01 PM

Norm

Re: StableMatch - Gale Shapley algorithm aka the Stable Marriage

The error message says what the problem is: cannot convert from Person<E> to E.
You have a type mismatch in an assignment statement.

09-13-2011, 11:08 PM

blaqkout

Re: StableMatch - Gale Shapley algorithm aka the Stable Marriage

Yeah, I know that the type in the signature is Person <E> (generic) and that the variable "match" is of type E (generic object). Can I cast it or is there something fundamentally wrong with my approach? I want to set the match of the person. Based on my other code do you have any suggestions?

09-13-2011, 11:14 PM

Norm

Re: StableMatch - Gale Shapley algorithm aka the Stable Marriage

Quote:

I want to set the match of the person

What is the type of variable can be assigned to the match variable?
match is type E
name is type Person<E>