Jump to ratings and reviews
Rate this book

Mastering Algorithms with C: Useful Techniques from Sorting to Encryption

Rate this book
There are many books on data structures and algorithms, including some with useful libraries of C functions. Mastering Algorithms with C offers you a unique combination of theoretical background and working code. With robust solutions for everyday programming tasks, this book avoids the abstract style of most classic data structures and algorithms texts, but still provides all of the information you need to understand the purpose and use of common programming techniques.

Implementations, as well as interesting, real-world examples of each data structure and algorithm, are included.

Using both a programming style and a writing style that are exceptionally clean, Kyle Loudon shows you how to use such essential data structures as lists, stacks, queues, sets, trees, heaps, priority queues, and graphs. He explains how to use algorithms for sorting, searching, numerical analysis, data compression, data encryption, common graph problems, and computational geometry. And he describes the relative efficiency of all implementations. The compression and encryption chapters not only give you working code for reasonably efficient solutions, they offer explanations of concepts in an approachable manner for people who never have had the time or expertise to study them in depth.

Anyone with a basic understanding of the C language can use this book. In order to provide maintainable and extendible code, an extra level of abstraction (such as pointers to functions) is used in examples where appropriate. Understanding that these techniques may be unfamiliar to some programmers, Loudon explains them clearly in the introductory chapters.

Contents

PointersRecursionAnalysis of algorithmsData structures (lists, stacks, queues, sets, hash tables, trees, heaps, priority queues, graphs)Sorting and searchingNumerical methodsData compressionData encryptionGraph algorithmsGeometric algorithms

1078 pages, Kindle Edition

First published August 5, 1999

55 people are currently reading
257 people want to read

About the author

Kyle Loudon

20 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
32 (25%)
4 stars
55 (43%)
3 stars
35 (27%)
2 stars
4 (3%)
1 star
1 (<1%)
Displaying 1 - 9 of 9 reviews
Profile Image for Dean Jones.
27 reviews4 followers
January 12, 2009
This book helped me learn beyond what Data Structures and Algorithm Analysis in C taught me. The code in this book is pretty well written except for the INSANE block comments everywhere in the book. The excessive commenting makes the code sort of hard to read.
Profile Image for caisah.
27 reviews
October 10, 2013
I tried to go on with this book but I just couldn't. It's not the fact that is badly written. It's the code and the design that make it a turnoff (at least in my case).

I picked up this book after K&R and I started reading it in parallel with Robert Sedgewick's Algorithms in C Parts 1-4. I have quickly noticed the resemblance but I was curious to also see the differences. Mastering Algorithms in C uses a much modern coding style but it is also more opinionated. The whole coding style seams much more complex and that is a pretty big minus. Let's also not talk about the comments... "I don't want to adopt your coding style, I just want to learn how to improve mine!" That's my main problem with it. The only thing that i found to be great was the Q&A section.

I don't expect everybody to share my opinion but I usually want to read top notch learning material written by already recognized figures. So I will stick with Sedgewick.

If you want lo learn about data structures and algorithms in C just pick Algorithms in C, Parts 1-4: Fundamentals, Data Structures, Sorting, Searching. You won't regret. That's as good as it gets.
Profile Image for Alex.
52 reviews10 followers
July 5, 2017
Generally a good book, and I did learn some new stuff from it. Very interesting Q&A sections in the end of every chapter and the case studies for most of the data structures, like frame management using singly lists or event handlers using queues, etc. I also liked that each of the data structure section contains a usable example of an API interface and an example implementation, so this book will make a good reference material as well.
I still think that the Algorithms by Robert Sedgewick (4th edition) is the best material on the topic (despite the use of Java), but this book does cover some specific aspects of C language.

The only downside for me was the poor style of the code examples. I find the use of those ridiculous block comments totally unnecessary, if not harmful given they make it harder and somewhat annoying to read the code. That however are only minor nuisances and do not diminish the value of the book in any way.
Also perhaps I'm being too pedantic, but casting the result of malloc/calloc/realloc is considered to be a bad practice in C, since it automatically and safely promotes void* to a pointer of any type and explicit casting can hide nasty bugs. Sadly it's a necessary evil in case a C++ compiler is used, but this book is about C and should have refrained from advertising bad practices, IMHO.
Profile Image for Jose Lopez.
4 reviews
March 5, 2017
The data structure section was amazing. The interfaces were intuitive and the author included several implementations like virtual memory and paging. The algorithms section was the best part of the book though. The section on numerical methods, specifically polynomial interpolation, was incredible. The only thing that could have made this book absolutely perfect would have been a data structure to work with arbitrarily large (or at least large enough) numbers. This is especially limiting for the encryption algorithms, since the author limited the implementation to unsigned long integers, rather than the necessary length keys and block sizes, but overall an awesome book.
28 reviews
April 20, 2008
This isn't a great algorithms book but it has decent pointers on C implementations.
5 reviews
July 4, 2016
Concise examples. Useful when working with the elementary problems of algorithms and the like which you certainly come across when taking any kind of education in the computer science field.
Displaying 1 - 9 of 9 reviews

Can't find what you're looking for?

Get help and learn more about the design.