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 42. Stacks and Queues

At this point in the book, you should know most of the data structures that are used to build all of the other data structures. If you have some kind of List, DArray, Hashmap, and Tree, then you can build almost anything else out there. Everything else you run into either uses these or some variant of these. If it doesn’t, then it’s most likely an exotic data structure that you probably won’t need.

Stacks and Queues are very simple data structures that are really variants of the List data structure. All they do is use a List with a discipline or convention that says you always place elements on one end of the List. For a Stack, you always push and pop. For a Queue, you always shift to the front, but pop from the ...

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