The Wayback Machine - https://web.archive.org/web/20111101203137/http://www.codeguru.com:80/cpp/cpp/algorithms/general/

    General

    C++ Programming: A Better Vector Trim Algorithm With Move Semantics

    Vectors are one of the single most useful and most used objects in the STL. They are easy to use, and remove the burden of memory management from the user. It is possible to partially control memory usage by using functions like reserve, but nothing is provided to free up excess memory. Users have come up with ways to trim a vector by hand, but with the advent of the new C++0x and its move semantics, the classic solution of copy-swaping has become excessively expensive. This article seeks to find a better solution.

    C++ Tutorial: 10 New STL Algorithms That Will Make You A More Productive Developer

    Unquestionably, the most effective tool for a C++ programmer's productivity is the Standard library's rich collection of algorithms. In 2008, about 20 new algorithms were voted into the C++0x draft standard. These new algorithms let you among the rest copy n elements intuitively, perform set theory operations, and handle partitions conveniently. Find out how to use these algorithms to make your code more efficient and intuitive.

    Classification Of Point In Polygon

    Classify a point respect to a plane polygon that can be concave (i.e. with some angle grater than 180 degrees). Good performance, excellent stability.

    [Updated] TIP: Half Size Triangular Matrix

    Learn about a technique that allows you to use half the data storage when you have a symmetric distance matrix or other similar triangular matrix.

    Linear Search based algorithm for Mth Lexicographic ordering of Mathematical Permutation and Combina

    Algorithms to compute the M-th lexicographic ordering of a permutation or combination and the inverse problem of the rank of a given permutation or sequence.

    Tip: An Optimized Formula for Alpha Blending Pixels

    Discover how to optimize by simplifying the formula.

    Making a Class Schedule Using a Genetic Algorithm

    Learn how to make a class schedule by using a genetic algorithm.

    [Updated] Copy Constructors and Assignment Operators

    Copying constructors and assignment operators is easy—once you learn the rules, and you can learn those rules right here.

    Properties in C++

    Learn how to simulate C# properties in C++.

    [Updated] A Deterministic Method of Determining a Document's Modified State

    Determine when a document has been modified. In the particular case of word processors, most tend to have a "dirty" flag that is set when a user types. This article demonstrates a smarter "dirty" flag that uses probabilistic methods.

    Doxygen: A Breath of Fresh Air for API Documentation

    The Doxygen documentation system addresses the age-old dilemma of how to keep documentation consistent with actual use cases by extracting it directly from the source code.

    Running State Machines-Based Win32/WinCE Programs

    Learn how to run state machine application framework-based Win32/WinCE programs using window message hooking technology.

    Anti-Aliased Image Transformation (Aaform)

    Given an image and a quadralateral, Aaform will fit the image onto the quadraleteral passed using geometry.

    Clone Smart Pointer (clone_ptr)

    Learn about a non-sharing smart pointer class that can be used with STL containers such as std::map, vector, list, set, and deque. The smart pointer has an assignment operator and greater than operator that call the target object's operator.

    [Updated] Delaunay Triangles

    Learn about an algorithm to calculate this intriguing and important data structure in computer graphics.

    Convert Numbers to Various Display Formats

    Learn about a set of several algorithms to convert a given number to various formats. This will add enhancement to your application.

    Selecting a Geometrical Object

    Learn about a method of selecting a geometrical object which is described by its vertices. This article might be of use if you are creating 2D or 3D shape related software.

    Message Digests and Digital Fingerprints

    Learn about an OO implementation of the MD5 algorithm in C++. It does not simply copy Ron Rivest's C code into a class. It was written to help provide a better understanding of MD5 and how C++ and its STL may be used to implement it. The code is not optimised.

    A Random Number Generation Technique with Encryption and Genetic Algorithm Applications

    This article describes some properties of linear feedback shift registers and provides sample applications of their use in Encryption and Genetic Algorithms.

    [Updated] A Demo of an AVL Tree

    Learn about using an AVL Tree, including inserting, removing, and searching a node.

    [Updated] Geographic Distance and Azimuth Calculations

    This article presents the basics of how to do geographic calculation for a spherical and ellipsoid Earth model, and provides sample code that implements solutions to several interesting geographic calculations.

    Functorized Undo/Redo

    Discover an implemtation of the Undo/Redo algorithm that marries the algorithm with the functor.

    Real-time plot

    Real-time plot