Thread: Is there any book with the collection of algorithms

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    82

    Is there any book with the collection of algorithms

    Is there any good book in which only different algorithms are explained for c++ ??

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

    You mean like the second book that results when "algorithm book for C++" is entered into Google?

    No. Why would there be such a book. That's just stupid.

    Soma

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    82
    sort of like all sorting algos, different linked list algos, encryption algos etc are mentioned

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

    Here you go...

    I've nothing else to say.

    Soma

  5. #5
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Quote Originally Posted by fredsilvester93 View Post
    sort of like all sorting algos, different linked list algos, encryption algos etc are mentioned
    This really has nothing to do with C++.

    I recommend volume 1 of The Art Of Computer Programming, by Knuth.
    There's no C++ in it, but then again asking for a book on algorithms and C++ is like asking for a book about cars and cakes.
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  6. #6
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Neo1 View Post
    This really has nothing to do with C++.

    I recommend volume 1 of The Art Of Computer Programming, by Knuth.
    There's no C++ in it, but then again asking for a book on algorithms and C++ is like asking for a book about cars and cakes.
    And suggesting Knuth to someone asking this exact question is lecturing about spaceships and paper airplane origami.

  7. #7
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Quote Originally Posted by manasij7479 View Post
    And suggesting Knuth to someone asking this exact question is lecturing about spaceships and paper airplane origami.
    Hmmm, well it has all of these:

    sort of like all sorting algos, different linked list algos, encryption algos etc are mentioned
    ...and more. It's a book about algorithms, what makes you think it wouldn't be a good choice for the OP?
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  8. #8
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Neo1 View Post
    ...and more. It's a book about algorithms, what makes you think it wouldn't be a good choice for the OP?
    I'm not saying it won't be.
    But it is not exactly suitable for someone looking for "only different algorithms are explained for c++".
    It requires you to learn a whole assembly language in the second chapter, at which I bailed out, honestly.
    I'll give it another try when I'm a more competent programmer and have more knowledge in mathematics.

  9. #9
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    asking for a book on algorithms and C++ is like asking for a book about cars and cakes
    Why?

    What sort of horrible past have you had to suggest that learning about algorithms in a language you are comfortable with is flawed?

    That comment of yours isn't just flawed. It is completely stupid.

    For every popular language there is a book devoted to teaching common algorithms using that language. Many of them do a much better job covering the common algorithms than the "Art of Computer Programming" does because of the huge breadth of the material that series presents.

    I'm totally serious here, how have you arrived at such a place as to present the above quoted comment?

    I'll give it another try when I'm a more competent programmer and have more knowledge in mathematics.
    It is an excellent series to read, but a terrible series from which to learn. Some of the "exercises" are research topics still unsolved.

    If you want to learn of the relevant algorithms I guarantee you that other many other books exist that can explain them satisfactorily without such a brutal purist approach.

    If you are already capable of doing independent research into algorithm design and implementation you'll find the "Art of Computer Programming" series a great gift.

    If you only want to know how a specific algorithm or class of algorithms works find a book that uses a language you are already familiar with using. Learning a new language just to consume dense material better presented by others is insane.

    Soma

  10. #10
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Quote Originally Posted by phantomotap View Post
    Why?

    What sort of horrible past have you had to suggest that learning about algorithms in a language you are comfortable with is flawed?

    That comment of yours isn't just flawed. It is completely stupid.
    1. Algorithms (or the most common of them atleast), are largely timeless. C++ is not, by choosing a book specific to a certain language you have essentially bought a book with an expiration date. I'm not saying this can be avoided with all books, but it can regarding algorithms.
    2. Learning to sort or search or whatever, in C++, might lock your understanding of certain algorithms to that specific language, and later on, when you've moved on to Erlang or Perl or w/e, you'll find yourself browsing Amazon for "Common algorithms in Perl". Buy a book that covers algorithms in a general sense instead.
    3. By the time you feel the need to expand your knowledge of common useful algorithms, you should easily be able to understand pseudocode, and know how to translate it to real code in whatever language you choose.

    Would you buy a book about driving a Ford... Or one that taught you how to drive a car??
    What about a book about astronomy, with a specific brand of telescope?

    For every popular language there is a book devoted to teaching common algorithms using that language. Many of them do a much better job covering the common algorithms than the "Art of Computer Programming" does because of the huge breadth of the material that series presents.
    Agreed, the OP didn't however specify whether he was looking for a book for complete beginners or for CS PHDs. He asked about a book for common algorithms, i find that TAOCP covers this subject better than any other book i've come across.
    In retrospect, i can see how my post would come across as elitist. Apologies to the OP.

    I'm totally serious here, how have you arrived at such a place as to present the above quoted comment?
    Blood, sweat and tears :-D

    It is an excellent series to read, but a terrible series from which to learn. Some of the "exercises" are research topics still unsolved.

    If you want to learn of the relevant algorithms I guarantee you that other many other books exist that can explain them satisfactorily without such a brutal purist approach.

    If you are already capable of doing independent research into algorithm design and implementation you'll find the "Art of Computer Programming" series a great gift.

    If you only want to know how a specific algorithm or class of algorithms works find a book that uses a language you are already familiar with using. Learning a new language just to consume dense material better presented by others is insane.

    Soma
    Disagreed, find a book about algorithms in general (Not necessarily TAOCP, i can recommend Introduction To Algorithms by Cormen, Leiserson, Rivest and Stein). If you then have trouble implementing it in a specific language, RTFM.
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  11. #11

  12. #12
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Algorithms are largely timeless.
    Algorithms are also language agnostic.

    Learning to sort or search or whatever, in C++, might lock your understanding of certain algorithms to that specific language, and later on, when you've moved on to Erlang or Perl or w/e, you'll find yourself browsing Amazon for "Common algorithms in Perl".
    The "Art of Computer Programming" series makes liberal and constant use of an academic assembler.

    With your logic of "Learning algorithms in a language $(X) may tie your understanding of algorithms to language $(X)." the "Art of Computer Programming" would literally be the worst book to learn from because it ties you to an academic constructed language almost never used in the outside world.

    Buy a book that covers algorithms in a general sense instead.
    Almost every algorithm book I've ever read describes the algorithm in general concepts only using real code as illustration.

    Like code, a book can be a bad regardless of the language.

    By the time you feel the need to expand your knowledge of common useful algorithms, you should easily be able to understand pseudocode, and know how to translate it to real code in whatever language you choose.
    The "Art of Computer Programming" series uses a constructed academic assembler; the series uses neither "pseudocode" or "real code".

    For a beginner, seeing how facilities are implemented is equally important to understanding how the facility works. To actual use the "Art of Computer Programming" series as an instruction book (instead of a reference for a master programmer) absolutely requires one to learn a language of extremely limited use.

    Would you buy a book about driving a Ford... Or one that taught you how to drive a car?? What about a book about astronomy, with a specific brand of telescope?
    Okay. Let's consider the practice of "driving" equivalent to the practice of "implementing algorithms". Would you rather learn to "drive" in a car that was manufactured by one person, gets zero miles to the gallon, and is missing features like tires that are crucial to the real world? Or would you rather learn to "drive" in a car you already own and have some experience with?

    We are discussing a situation in which a request was made for an "algorithms book in C++" and you suggested the "Art of Computer Programming" series. A person asked for an orange because it was the flavor they wanted and you suggest spinach partially because you didn't even bother to factor in the nature of the request.

    He asked about a book for common algorithms, i find that TAOCP covers this subject better than any other book i've come across.
    It doesn't.

    You clearly either have not studied the "Art of Computer Programming" series or have not read the majority of other books.

    The "Art of Computer Programming" series has overwhelming depth and breadth. It does a lousy job of presenting algorithms. The "Wikipedia" page for the common "insertion sort" does a better job than the "Art of Computer Programming" series. The "Wikipedia" page doesn't devolve into several dozen pages about optimizations and research that are beyond the grasp of most doctoral candidates. The "Wikipedia" page doesn't offer a suggestion for a magic constant time mutation to a hash table because the underlying hardware it was based on doesn't and probably never will exist.

    The "Art of Computer Programming" series is ........ing amazing, but it is not and never will be a source for learning common algorithms.

    If you want to study existing research into refinements of the common algorithms on your way to a doctoral thesis the "Art of Computer Programming" series is where you'll find it.

    find a book about algorithms in general
    Agreed.

    I suggest you go read the index for "Art of Computer Programming" series at your next earliest convenience. There is truly nothing "general" or "common" about the series. It is a dense mess of a catalog documenting hundreds or thousands of man years of research into common, uncommon, rare, unusual, theoretical, and impractical algorithms with notes about cache coherency, new research, practical implementation, practical limits, the performance, the academic performance, memory use, and theoretical advancements related to research that has only barely started.

    What you are suggesting is literally the equivalent of suggest an theoretical physics text book by "Stephen Hawking" when an elementary textbook is needed.

    Soma

  13. #13
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Phantomotap:

    I'm not going to defend the use of MMIX, i suggest you read the preface to volume 1 if you want to see some compelling arguments.

    As you might or might not have read, i revised my suggestion and apologised to the OP for being an elitist jerk.

    It doesn't.

    You clearly either have not studied the "Art of Computer Programming" series or have not read the majority of other books.

    The "Art of Computer Programming" series has overwhelming depth and breadth. It does a lousy job of presenting algorithms. The "Wikipedia" page for the common "insertion sort" does a better job than the "Art of Computer Programming" series. The "Wikipedia" page doesn't devolve into several dozen pages about optimizations and research that are beyond the grasp of most doctoral candidates. The "Wikipedia" page doesn't offer a suggestion for a magic constant time mutation to a hash table because the underlying hardware it was based on doesn't and probably never will exist.
    What? You state that it doesn't cover common algorithms, and then procede to describe its depth and breadth on the subject of algorithms. Makes sense.

    Nowhere in this thread has the OP stated he was looking for a book for beginners, only that he wanted one specific to C++. After having been offered nothing from your first couple of sly remarks, i told him to lose the C++ part and go read TAOCP. I'm not going to put up with this ........storm, i've recommended two great books throughout this thread, you've done nothing but troll and flame, why are you even here?
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

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

    Are you really that oblivious and insincere?

    *shrug*

    It is perfectly obvious "why I'm here"; I'm attacking your foolish book recommendation in the hopes that it will prevent someone from reading the "Art of Computer Programming" series until they are ready or better still use it as a reference and "read it" not at all.

    Soma

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Algorithms and data structures book?
    By Lechx in forum C++ Programming
    Replies: 6
    Last Post: 09-30-2008, 09:05 PM
  2. collection
    By AngKar in forum C# Programming
    Replies: 1
    Last Post: 07-01-2006, 02:47 AM
  3. A good book on algorithms ?
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 11-23-2001, 03:58 PM
  4. A good book on algorithms for C
    By pritesh in forum C Programming
    Replies: 5
    Last Post: 11-16-2001, 02:12 AM