Thread: Hardest Data structure type

  1. #1
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    693

    Hardest Data structure type

    I was just curious what some of you more advanced programmers feel is the hardest type of tree to incorporate in data structure, have you ever had to use one professionally? Has anyone had previous experience with red-black trees, I heard they werent of much use.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by camel-man
    I was just curious what some of you more advanced programmers feel is the hardest type of tree to incorporate in data structure, have you ever had to use one professionally?
    Probably some "ironwood" tree
    Actually, I have had pretty much no reason to implement any difficult to implement tree structures outside of an academic exercise because thus far higher level components (e.g., set and map containers) have satisfied my needs in the programming languages I use professionally.

    Quote Originally Posted by camel-man
    Has anyone had previous experience with red-black trees, I heard they werent of much use.
    They are useful to implement higher level components such as those that I mentioned.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    Quote Originally Posted by laserlight View Post
    Probably some "ironwood" tree
    Nope! a diamond-wood tree would be the hardest, in my opinion

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by camel-man View Post
    I was just curious what some of you more advanced programmers feel is the hardest type of tree to incorporate in data structure, have you ever had to use one professionally? Has anyone had previous experience with red-black trees, I heard they werent of much use.
    Red-black trees are commonly used in C programming, if you look at the source for a large C program there's often either a RB tree or a hash table implementation in them. Big libraries will implement them too, eg glib on linux has general purpose RB trees and hash table data types in it.

    Generally with the dynamic structures I need, the important part is just an in-place add and delete, and the data set is not large, so I'll just use a linked list and iterate through it for look-ups (gasp!), or a hash table, depending on the nature of the task.

    I have written a bayer tree (a form of RB tree) as an exercise before. It tested pretty well against C++ maps (which are RB trees) but I ended up never using the code for anything. I think if I needed a tree again I would just do a straight RB tree, the bayer is ridiculously complex. Ie, yeah I thought it was hard but like a lot of things, I'm sure it would get much easier if you worked with them often enough and became familiar with various subtleties and issues.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  5. #5
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    I'd say red-black tree was the hardest one I did. It's certainly harder than splay, AVL (height or balance factor based), scapegoat, and AA trees.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  6. #6
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    Are we talking general purpose? Or any tree structure of any kind?

    *shrug*

    I guess I'd say either a "RB" or differencing "B*Tree" with shared interior nodes (a "shadowing" tree).

    Soma

  7. #7
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    693
    Ive heard there were lots of different data structure trees, and yet I have not taken any classes yet on them, I am a little nervous because from what I have heard data structures and algorithms I and II are the hardest in the department for CS majors. any tips?

  8. #8
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by itCbitC View Post
    Nope! a diamond-wood tree would be the hardest, in my opinion
    *wooosh*

    There are actually trees known as ironwood trees.


    Quzah.
    Hope is the first step on the road to disappointment.

  9. #9
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    *wooosh*

    A lame joke is still a joke. Also, a link from your friendly neighborhood carpenter.

    Soma

    Diamond willow - Wikipedia, the free encyclopedia

  10. #10
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Willows aren't hard wood. I know you have to disagree with everything I say just out of spite, but it doesn't make you right. Also, he said "diamond wood", not "diamond willow". There's no such thing as a "diamond wood tree". There are however ironwood trees.

    Like I said, just disagreeing out of spite doesn't make you right.


    Quzah.
    Hope is the first step on the road to disappointment.

  11. #11
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by quzah View Post
    There are actually trees known as ironwood trees.

    Quzah.
    wikipedia is missing a entry on it.
    Tree (data structure) - Wikipedia, the free encyclopedia

    Edit: I guessed laserlight was joking; but you were not joking. I could be wrong. Maybe you were also joking.

    Tim S.
    Last edited by stahta01; 06-27-2011 at 05:24 PM.

  12. #12
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by stahta01 View Post
    wikipedia is missing a entry on it.
    Tree (data structure) - Wikipedia, the free encyclopedia

    Tim S.
    /facepalm

    *adds one more to the list of people here with no sense of humor*


    Quzah.
    Hope is the first step on the road to disappointment.

  13. #13
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by quzah View Post
    /facepalm

    *adds one more to the list of people here with no sense of humor*
    Quzah.
    I got a sense of humor; your joke was not funny; therefore I did not think it was a joke.

    Tim S.

  14. #14
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by stahta01 View Post
    I got a sense of humor; your joke was not funny; therefore I did not think it was a joke.
    It wasn't my joke. So not only do you not have a sense of humor, you can't follow a simple thread. You and phapp should form a humorless club, and then beat each other with it.


    Quzah.
    Hope is the first step on the road to disappointment.

  15. #15
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    You and phapp should form a humorless club, and then beat each other with it.
    I assume you're suggesting an ironwood club?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-14-2011, 09:26 PM
  2. hardest part of parsing c++?
    By underthesun in forum C++ Programming
    Replies: 10
    Last Post: 04-30-2011, 03:05 PM
  3. store string data as a short or other data type
    By robin2aj in forum C Programming
    Replies: 5
    Last Post: 04-07-2010, 11:02 AM
  4. Data structure for storing serial port data in firmware
    By james457 in forum C Programming
    Replies: 4
    Last Post: 06-15-2009, 09:28 AM
  5. Replies: 9
    Last Post: 06-13-2009, 02:31 AM