Thread: What's a good data structures book for C?

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    72

    What's a good data structures book for C?

    I would like to find a data structures book that uses straight C, is designed pretty well, helps you build your own little data structures library, etc. Any recommendations would be great, thanks.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Data structures on their own is usually not particularly meaningfull. Studying algorithms (there are MANY books on the subject, I have one by "sedgewick" that is OK) will also cover some types of data structures (such as linked lists, various types of trees, hash-tables to name but a few).

    Also books about "good programming" often cover "how to create a good data structure".

    Once you have that basic understanding, the usage of data structures in general should be covered. There will of course be "problem specific" data structures (3D graphics uses something called a quad-tree, for example). Those would be part of any book on the relevant subject.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    14
    Hello,
    Like philvaira i'm also looking for a good book, e-book or some links preferablly with examples to help me on the subject abstract, generalized data structures, so i won't be limited to int, char or struct, when using them in single/double lists.


    Thank you.

  4. #4
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    IMO, your best bet is to use a void * in a linked list structure as the data type that it holds, and keep the list ignorant about the type that it will use.

    Have the programs that use the list deal with what types should be in the list or not in the list. If you have to deal with multiple types, perhaps you could use a struct that contains a union of different types. In addition, your struct could contain an enum or int var that lets your program know what variable a node is actually of.

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    14
    thank you, but beside the fact that I'm at beginner level , it's also a big chaos in my head, so i really need to read more about structures and lists and see some clear examples of what i might need for my homework.

    I konw it's not the best method to learn but i have no choice. Anyway i found some titles in the recommandation topic hope i'll find the books too.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 12-05-2008, 02:18 AM
  2. Is this book <JAVA in a netshell> good for C++ programmers?
    By meili100 in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 10-28-2008, 02:28 AM
  3. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM
  4. A good book on algorithms for C
    By pritesh in forum C Programming
    Replies: 5
    Last Post: 11-16-2001, 02:12 AM