0
C-sucks
3y

upvote your favorite data structure:
scroll down to comments and upvote the one you love to play with, the most.

Comments
  • 1
    Linked List
  • 1
    Stack
  • 1
    Queue
  • 0
    Trees
  • 0
    Graph
  • 1
    HashMap
  • 3
    Array
  • 1
    primitives
  • 4
  • 1
    Waw, you've missed double ended queues... I have nothing to say to you sir...
  • 1
    @Hazarth wtf mate! you should understand by urself, if I would have implemented your thought then I would have mentioned more than 20 different tree structures
  • 0
    @UnicornPoo why not, I love to play with graphs.
  • 0
    @asgs I reckon primitives has got a bad name under "data structure", I prefer to call them data type instead of "data structure"
  • 1
    @C-sucks Data structure nevertheless
  • 0
    @C-sucks yeah but one does not use javascript to make desktop apps.

    Well yeah, they didn't ask themselves if they **should** have done it, so they made the apps and the performance's
    h o r r i b l e.
  • 0
    StackOverflow.....
  • 1
    Hashes are my favorite tool, but not to play with.

    Linked lists are fun; not really sure why.
  • 1
    Obvious conclusion: nobody uses anything but arrays
  • 1
    struct {

    int W;

    int T;

    int F;

    };

    My favorite is the one I need to solve a particular problem. Is this something to mock people who have favorite patterns? Some answer for those.
  • 3
    @Demolishun Ha. I get what you’re saying, and agree. You should always use the best tool for the job. Picking a different tool because you like it more is just silly.

    On the other hand, surely you’ve found a particular structure or implementation neat and satisfying? That’s the linked list for me. Another favorite of mine is the Pascal string. I rarely ever find a use for it, but it brings me joy when I do.
  • 1
    @Root I guess classes in c++. You can create operators for them and make them into just about anything you want. You can make them have iterators so they work with the std::algorithm fairly easily. Self referencing allows you to do call chaining and all sorts of neat tricks.

    I also like function pointers. Sometimes you just need a function as data. Having standardized function pointers is fun.

    Are linked lists a design pattern or a data structure? I mean the list is nothing without its methods. Probably similar for classes.
  • 1
    @Demolishun Depends if it’s meant for data or logic. The more tightly coupled your implementation is to your data, the grayer that distinction gets.

    Anyway, I totally agree with self-referencing classes. Chaining is jazzy. I also really enjoy using that to make DSL’s that read like English. 😊
  • 2
    @Root Some people hate the chaining. Makes me want to do more chaining.
  • 1
  • 2
    Most of my non-primitive data structures are arrays. Majority of the rest are some type of KV pairs.

    If the problem requires snowflakey structures for decent performance then I pick a snowflakey data structure. Best to stick to basics when possible.
Add Comment