Skip to Main Content
Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)
book

Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)

by Zed A. Shaw
July 2015
Intermediate to advanced content levelIntermediate to advanced
380 pages
10h 15m
English
Addison-Wesley Professional
Content preview from Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)

Exercise 33. Linked List Algorithms

Im going to cover two algorithms for a linked list that involve sorting. I’m going to warn you first that if you need to sort the data, then don’t use a linked list. These are horrible for sorting things, and there are much better data structures you can use if that’s a requirement. I’m covering these two algorithms because they are slightly difficult to pull off with a linked list, and to get you thinking about how to efficiently manipulate them.

In the interest of writing this book, I’m going to put the algorithms in two different files list_algos.h and list_algos.c then write a test in list_algos_test.c. For now, just follow my structure, since it keeps things clean, but if you ever work on other libraries, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern C for Absolute Beginners: A Friendly Introduction to the C Programming Language

Modern C for Absolute Beginners: A Friendly Introduction to the C Programming Language

Slobodan Dmitrović

Publisher Resources

ISBN: 9780133124385Purchase Link