data structure problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dawn

    #1

    data structure problem

    Hi,

    I need to find a way to efficiently implement a data structure for this
    problem.

    I have a set of coordinates that should be stored like this

    level 0 co1 co2 co3 co4 co5 ....(i don't know
    how many items there are)
    / \
    level 1 le1co1 le1co1.... (same thing here.....depend s on user
    input how many children

    well the same things is true for level2 upto level5 (so maximum depth = 6)

    What I need it for is this, the coordinates point to a letter on the screen,
    but there can be multiple entries for 1 letter. Like when A is pressed and
    there are 15 A's on the screen, level0 holds 15 entries. Then when B is
    pressed.....i need to find letters B who's coordinates are adjacent to the
    coordinates of a letter A, if such a letter B exists for any given A, its
    coordinates are a child of that letter A, if no such letter B exists, I need
    to remove the coordinates of A from level0.

    If anyone could help me with an efficient way of implementing this, I'd be
    grateful.

    Thanks.


Working...