No, I don't think that method would work. It relies too much on
chronology. You would end up with problems even during data input.

I'm thinking of a class that needs data for each state to be fed once
in the following manner :

State: KS
Neighbours: CO, OK, MO, NE

State: NE
Neighbours: WY, CO, KS, MO, IA, SD

and perform lookups on the Neighbour values based on any State key...
something like a NameValueCollection (which would work, but read
on...)

What I'm not too happy with is the duplication. I'd be happier if I
could think of something by which the class would recognize that if KS
is a neighbour of NE, then NE is a neighbour of KS.

On May 16, 10:09 pm, Brandon Betances <[email protected]> wrote:
> Assign every state a number geographically. Start with Maine, assign it #1,
> Vermont #2, NH #3, etc. Then when you input a state, lets use Rhode Island
> which would be #5, #4 (Massachussets), and Connecticut (#6), would have to
> be adjacent to the state in question. Rough solution, but it could work with
> a bit of planning. If California is #47, then #46 Nevada and #48 Oregon
> should pop up as neighbors. You might run into problems with Alaska and
> Hawaii however, so just make sure #49, 50 and 51 (Puerto Rico) don't have
> any neighbors. Lemme think about this a bit more at work tonight and ill let
> you know what I come up with.

Reply via email to