Mastering Algorithms with C [NOOK 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.


See more details below
Mastering Algorithms with C

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$19.99 price
(Save 44%)$35.99 List Price


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 include:

  • Pointers
  • Recursion
  • Analysis of algorithms
  • Data structures (lists, stacks, queues, sets, hash tables, trees, heaps, priority queues, graphs)
  • Sorting and searching
  • Numerical methods
  • Data compression
  • Data encryption
  • Graph algorithms
  • Geometric algorithms

For anyone with a basic understanding of C, the robust solutions found here will offer help for everyday programming tasks, providing all the necessary information to understand and us common techniques. Includes implementations and real-world examples of each data structure in the text, and full-source code on the accompanying disk.

Read More Show Less

Editorial Reviews

Library Journal
Although older than some of the current languages, C still is one of the best general purpose programming languages around. Loudon's book discusses C pointers, recursion, data structures from lists and stacks to trees and graphs, sorting and searching, and encryption. This is not a beginner's manual but will work well for programmers wanting to refresh their C techniques and for those moving from another language to C. Copyright 1999 Cahners Business Information.
Read More Show Less

Product Details

  • ISBN-13: 9780596551957
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 8/5/1999
  • Series: Mastering
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 562
  • File size: 3 MB

Meet the Author

Kyle Loudon is a software engineer at Matrix Semiconductor in Santa Clara, California, where he works with file systems and applications for memory chips. Prior to Matrix, Kyle developed platform software for embedded devices, including various wireless phones and the Apple iPod. He also led the graphical user interface group at Jeppesen Dataplan (now a part of Boeing), developed flight planning software, and created system software at IBM in the early 1990s. For the past several years, Kyle has taught object-oriented programming using C++ at the University of California, Santa Cruz Extension, and has worked with C++ since the beginning of its widespread use in 1990. Kyle is the author of Mastering Algorithms with C, also published by O'Reilly and Associates.

Read More Show Less

Table of Contents


I. Preliminaries

1. Introduction
     An Introduction to Data Structures
     An Introduction to Algorithms
     A Bit About Software Engineering
     How to Use This Book

2. Pointer Manipulation
     Pointer Fundamentals
     Storage Allocation
     Aggregates and Pointer Arithmetic
     Pointers as Parameters to Functions
     Generic Pointers and Casts
     Function Pointers
     Questions and Answers
     Related Topics

3. Recursion
     Basic Recursion
     Tail Recursion
     Questions and Answers
     Related Topics

4. Analysis of Algorithms
     Worst-Case Analysis
     Computational Complexity
     Analysis Example: Insertion Sort
     Questions and Answers
     Related Topics

II. Data Structures

5. Linked Lists
     Description of Linked Lists
     Interface for Linked Lists
     Implementation and Analysis of Linked Lists
     Linked List Example: Frame Management
     Description of Doubly-Linked Lists
     Interface for Doubly-Linked Lists
     Implementation and Analysis of Doubly Linked Lists
     Description of Circular Lists
     Interface for Circular Lists
     Implementation and Analysis of Circular Lists
     Circular List Example: Second-Chance Page Replacement
     Questions and Answers
     Related Topics

6. Stacks and Queues
     Description of Stacks
     Interface for Stacks
     Implementation and Analysis of Stacks
     Description of Queues
     Interface for Queues
      Implementation and Analysis of Queues
     Queue Example: Event Handling
     Questions and Answers
     Related Topics

7. Sets
     Description of Sets
     Interface for Sets
     Implementation and Analysis of Sets
     Set Example: Set Covering
     Questions and Answers
     Related Topics

8. Hash Tables
     Description of Chained Hash Tables
     Interface for Chained Hash Tables
     Implementation and Analysis of Chained Hash Tables
     Chained Hash Table Example: Symbol Tables
     Description of Open-Addressed Hash Tables
     Interface for Open-Addressed Hash Tables
     Implementation and Analysis of Open Addressed Hash Tables
     Questions and Answers
     Related Topics

9. Trees
     Description of Binary Trees
     Interface for Binary Trees
     Implementation and Analysis of Binary Trees
     Binary Tree Example: Expression Processing
     Description of Binary Search Trees
     Interface for Binary Search Trees
     Implementation and Analysis of Binary Search Trees
     Questions and Answers
     Related Topics

10. Heaps and Priority Queues
     Description of Heaps
     Interface for Heaps
     Implementation and Analysis of Heaps
     Description of Priority Queues
     Interface for Priority Queues
     Implementation and Analysis of Priority Queues
     Priority Queue Example: Parcel Sorting
     Questions and Answers
     Related Topics

11. Graphs
     Description of Graphs
     Interface for Graphs
     Implementation and Analysis of Graphs
     Graph Example: Counting Network Hops
     Graph Example: Topological Sorting
     Questions and Answers
     Related Topics

III. Algorithms

12. Sorting and Searching
     Description of Insertion Sort
     Interface for Insertion Sort
     Implementation and Analysis of Insertion Sort
     Description of Quicksort
     Interface for Quicksort
     Implementation and Analysis of Quicksort
     Quicksort Example: Directory Listings
     Description of Merge Sort
     Interface for Merge Sort
     Implementation and Analysis of Merge Sort
     Description of Counting Sort
     Interface for Counting Sort
     Implementation and Analysis of Counting Sort
     Description of Radix Sort
     Interface for Radix Sort
     Implementation and Analysis of Radix Sort
     Description of Binary Search
     Interface for Binary Search
     Implementation and Analysis of Binary Search
     Binary Search Example: Spell Checking
     Questions and Answers
     Related Topics

13. Numerical Methods
     Description of Polynomial Interpolation
     Interface for Polynomial Interpolation
     Implementation and Analysis of Polynomial Interpolation
      Description of Least-Squares Estimation
     Interface for Least-Squares Estimation
     Implementation and Analysis of Least-Squares Estimation
     Description of the Solution of Equations
     Interface for the Solution of Equations
     Implementation and Analysis of the Solution of Equations
     Questions and Answers
     Related Topics

14. Data Compression
     Description of Bit Operations
     Interface for Bit Operations
     Implementation and Analysis of Bit Operations
     Description of Huffman Coding
     Interface for Huffman Coding
     Implementation and Analysis of Huffman Coding
     Huffman Coding Example: Optimized Networking
     Description of LZ77
     Interface for LZ77
     Implementation and Analysis of LZ77
     Questions and Answers
     Related Topics

15. Data Encryption
     Description of DES
     Interface for DES
     Implementation and Analysis of DES
     DES Example: Block Cipher Modes
     Description of RSA
     Interface for RSA
     Implementation and Analysis of RSA
     Questions and Answers
     Related Topics

16. Graph Algorithms
     Description of Minimum Spanning Trees
     Interface for Minimum Spanning Trees
     Implementation and Analysis of Minimum Spanning Trees
     Description of Shortest Paths
     Interface for Shortest Paths
     Implementation and Analysis of Shortest Paths
     Shortest Paths Example: Routing Tables
     Description of the Traveling-Salesman Problem
     Interface for the Traveling-Salesman Problem
     Implementation and Analysis of the Traveling-Salesman Problem
     Questions and Answers
     Related Topics

17. Geometric Algorithms
     Description of Testing Whether Line Segments Intersect
     Interface for Testing Whether Line Segments Intersect
    Implementation and Analysis of Testing Whether Line Segments Intersect
     Description of Convex Hulls
     Interface for Convex Hulls
     Implementation and Analysis of Convex Hulls
      Description of Arc Length on Spherical Surfaces
     Interface for Arc Length on Spherical Surfaces
     Implementation and Analysis of Arc Length on Spherical Surfaces
     Arc Length Example: Approximating Distances on Earth
     Questions and Answers
     Related Topics


Read More Show Less

Customer Reviews

Average Rating 3
( 4 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Anonymous

    Posted November 29, 2003

    A very nice book.

    I found this book to be very nice. It gives a great introduction to data structures using the C language. It also gives some great intro. details to some topics used throughout the book, like recursion, O-notation, and how to analyze the efficiancy of your algorithm. Something not stressed enough these days, IMO. It does an excellent job of exploring the theory, and details behind each type of data structure, then continues on to a very concise example of it in action. It does a great job of breaking down every function and actually explaining what every function is going to do. It tells you exactly what role it plays in the entire data structure, very nice to have. The code is very easy to understand. Each function is kept to a minimum, and things are logically organized, and broken up. Very nice to see that. My only problem with the book is the accompanying disk was a diskette. I don't know about anyone else, but for me they have a short shelf life. I was able to get the contents, but now the diskette is basically broken. Would have been great to get that on a little more trustworthy medium such as CD (However offers zip\.tar.gz files of the examples. So not all is lost, that is mighty cool of them). This book definitely assumes a good deal of knowledge in the C language. I would recommend one learn minimally basic functions, pointers, function pointers, dynamic memory allocation\deallocation, your basic if\else statements, looping, etc... before trying to read this. It would be possible, but i'm sure more frustrating then need be. If you don't understand those things most of the example code will be very hard to understand. Other then that if you're looking for a great introduction book, and something to hold on to for a great reference, this is it. All around good book. Hope it helps someone...

    1 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Posted August 14, 2011

    Sample does not open.


    0 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted October 25, 2000

    most Oreilly books are usually pretty good but.

    I found this book to have an ambiguous presentation. The examples are vague and strange. Most of them abuse the use of the preprocessor so much that its hard to exactly tell what is going on in the code. It is not that i think useing macro's are bad its just that there are so many of them and well, people buy books for clarity. If i wanted to see a the best linked list some one could write I could find plenty of examples on the net. This code reminds me of the obfuscated code you see in some contests.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted July 4, 2011

    No text was provided for this review.

Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)