#1
  1. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    191

    Online-sites about algorithms and optimization?


    Hi ppl!

    As i am getting deeper into optimizing my C code right now, i wonder:
    Is there something online on the 'net similar to the book "Algorithms in C" that i´ve been told to read quite often recently? Sorry, I really don´t have any money right now... i am still waiting for january´s salary to arrive on my account Also i fear this book will only cover the basics... (anyone did read it?)

    I want to say:
    Does anyone have a good link to sites discussing optimizing "standard" algorithms? like fast matrices operations, fast binary trees operation, fast vector mathematics, even simple array/hash searching and such?
    And still also telling me basic infos (=backgrounds) about how and *why* to implement a certain algorithm?

    when i asked Dr.Google, he´d tell me >1,000,000 crappy pages. Even after hours of consulting...
    I do know how to implement a linked list. I want to know how to optimize it though, if necessary, down to assembly level and for certain CPUs only (if there is no "better" solution)...

    Anyone got some links for me?
    Maybe i´m asking too much. Maybe my problems are too specific to be answered on a single site... Still, please share any good link related to this you´ve got in your bookmarks collection...
    TIA,
    ... M.
  2. #2
  3. Me likey breadsticks...
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2003
    Location
    Los Angeles
    Posts
    1,189
    Rep Power
    18
    Sorry don't got any links for you, but if you're talking about Algorithms in C by Robert Sedgewick, I had to use it for a CS class back in college. While it does have stuff regarding the topics you discuss (binary trees, hashing/searching/sorting, etc) I don't believe it goes into as much detail as you are asking for. As far as I can remember it won't help with stuff like:
    I want to know how to optimize it though, if necessary, down to assembly level and for certain CPUs only (if there is no "better" solution)...
    If you're not finding good sites regarding the algorithms you seek I think your best bet is just posting questions in the forums or if you need the answers even quicker just sit in #C in IRC.

    Sorry I couldn't be more help. As you've helped me a bunch in the past with my linux questions
    -b
    PostgreSQL, it's what's for dinner...
  4. #3
  5. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    If you're interested in working in C++ rather than C, then the STL library might be the way to go. I have some decent STL links for you. They don't go much into explaining the exact algorithms involved, but they tell you what to use where Let me know if you want to use STL and I'll paste the links here.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    191
    Thanks to both of you.

    Scorpions4ever: I looked into STL earlier, seemed not too complicated. But didn´t think they would improve speed over standard linked lists (as on first glance they only seemed to define the operators for easy working with trees, lists, etc).

    A link that explains which of the template functions to use best for which problem would be nice too ... makes me think ... re-designing my structures/variables layout would probably speed it up anyway LOL ... but if i have to redesign them anyway, i can just as well switch over to STL in this step too...

    One questions: is there different implementations of STL? (so i could develop with one for now, and if speed becomes an issue again, switch to another one?)
  8. #5
  9. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    This would be a good place to start:
    http://www.cs.brown.edu/people/jak/p...tltut/tut.html
    http://www.yrl.co.uk/~phil/stl/stl.htmlx
    http://www.xraylith.wisc.edu/~khan/s...TL.newbie.html

    The third link is outdated, but it has links to various STL implementations at the bottom. Also, the third link contains a link to a lot of examples.

    There are several STL implementations -- you can get some of them from the third link and another one is http://www.stlport.org/
  10. #6
  11. Me likey breadsticks...
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2003
    Location
    Los Angeles
    Posts
    1,189
    Rep Power
    18
    Well, I'm at work right now so I don't have all my bookmarks, but I'll check them out when I get home to see if I have anything that might be up your alley. I know it doesn't help to recommend a book since that was the point of your original post, but if you do get some cash you might wanna invest in The C++ Programming Language by Bjarne Stroustrup (the creator of C++) which is packed with more C++ than I'll ever know and has many examples of STL within it.

    In regards to your question about different implementations of STL, I do believe that there are different implementations. In fact if you're concerned about performance, this quote may intereste you
    >Today's implementations of STL are indeed not optimal. But the logic
    >behind using them is their wide-spread use will ensure that they're
    >well tested and bug-free.
    Which, just for reference of where the quote came from, not necessarily relevance to the topic at hand is at:

    http://groups.google.com/groups?q=di...nd.com&rnum=19

    -b
    PostgreSQL, it's what's for dinner...

IMN logo majestic logo threadwatch logo seochat tools logo