Thread: Lists

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Lists


    I have something to ask you . I am stucked in a serius project of C programming. i have to do the following :

    You will need two data structures for the program:
    - A cross-list which stores the words of the dictionary.
    In a node that stores a word list
    - A cross-list that stores categories (equivalence classes) words.
    In a node of this list is stored:
    - The representative of the class
    - The number of words that belong in this category.
    - A dynamic array of indicators tied to the words of this class (as
    stored in list-dictionary.

    any help?
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,593
    Rep Power
    4207
    If you are going to need to search the list of words quickly, I'd declare a hash map structure to store the list of words and the data that is associated with each word. And within the data structure, I'd use a dynamic array structure for the array of indicators and the category list.

    You could use a library such as Apache's APR library, that already has a lot of this code (hashes, dynamic arrays etc.) implemented for you and it is cross-platform as well. See http://apr.apache.org/ for details.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0
    hmmm i am actually writing C in Opensuse linux. can you give me an example of code? i want to see some code in order to understand, if you can of course.

IMN logo majestic logo threadwatch logo seochat tools logo