Algorithms and data structures are difficult to implement.
One must:
- understand the algorithm
- decide on implementation details
- design interface
- implement
- test and debug
- optimize
- document
- maintain
Starting from existing (non-library) code is often no easier.
- code is hard to understand
- poor documentation
- difficult to modify
- may contain errors
- unstated assumptions
- written for different programming environment
Algorithm libraries can help. They are (usually, to some degree):
- well-tested, more likely correct
- optimized
- well-documented
- adaptable
- portable
But learning to use an algorithm library is not easy.
One must:
- choose a suitable library
- find documentation
- learn the basics of the library
- learn to use the algorithm you need
- adapt it for your purpose
Using a library algorithm may require as much effort as implementing
your own algorithm, but the result is more likely
- correct
- efficient
- at least partially documented
- portable
- easy to maintain (in the long term)
During this course we learn a little about some commonly used
algorithm libraries.
- other libraries are often similar
There is a strong emphasis on STL - the Standard Template Library
- part of the C++ Standard Library
- generic programming paradigm
Other libraries
- large collection of public libraries
- includes early versions of future standard library
- CGAL - Computational Geometry Algorithms Library
- LEDA - Library of Efficient Data types and Algorithms
- ???