Problem in choosing data structure

Discussion in 'C' started by tonyaim83, Jan 23, 2008.

  1. tonyaim83

    tonyaim83 New Member

    Joined:
    Jan 23, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    What i want is to first store the given input as follows :-
    {{{A,B},{B,C},{C,D}},{{A,C},{C,E},{E,F},{F,P}}}
    and then make a check if the pair is present in particular subset of a set.
    For e.g if the user can give index 0 and pair {B,C} we need to search the first index value i.e {{A,B},{B,C},{C,D}} and return true or false based on its presence. What data structure i should use. I tried vector but not helping me
    Kindly help
     
  2. KaiyureBoy

    KaiyureBoy New Member

    Joined:
    May 17, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    I am appreciated for this pretty article. thanks.

    would you mind PM your MSN to me? thanks.
     
  3. Mahesh.Shetye

    Mahesh.Shetye New Member

    Joined:
    Mar 22, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    I will use map of linked-list pointers. So based on index, I will get the list in which I need to search for the pair. The reason behind using linked list is the sets you have shown are having different number of character pairs. And map will allow me to search fast based on the index.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice