cunixdata-structures

Are there standard Queue implementations for C?


Is there any Queue data structure implementation that "comes" with C or will I have to develop my own (this is for a school project, thus I must use something that either exists in the standard gcc installation or have to implement one by myself!)

What about other general data structures like Linked Lists, Stacks, etc?


Solution

  • You must implement your own. C has very little in terms of data structures and forces you to resort to arguable tricks to implement abstract data types: see an article titled “Incomplete types as abstractions” if you can find it, or see how the principles are applied in, say, PolarSSL's bignum.h file. C++ on the other hand is supposed to allow you to do pretty much everything you can do in C and give you ways to implement abstract data structures.