#include <algorithm> template<class Iterator> void insertion_sort( Iterator a, Iterator end ) { std::iter_swap( a, std::min_ele
Continue ReadingC++: Heap Sort
#include <algorithm> // for std::make_heap, std::sort_heap template <typename Iterator> void heap_sort(Iterator begin, Iterator en
Continue ReadingC++: Enforced Immutability
Demonstrate any means your language has to prevent the modification of values, or to create objects that cannot be modified after they have been creat
Continue ReadingC++: Fibonacci Sequence
The Fibonacci sequence is a sequence Fn of natural numbers defined recursively: F0 = 0 F1 = 1 Fn = Fn-1 + Fn-2, if n>1 Write a function to ge
Continue ReadingC++: Delegates
A delegate is a helper object used by another object. The delegator may send the delegate certain messages, and provide a default implementation when
Continue ReadingC++: Ackermann Function
The Ackermann function is a classic example of a recursive function, notable especially because it is not a primitive recursive function. It grows ver
Continue ReadingC++: Mutual Recursion
Two functions are said to be mutually recursive if the first calls the second, and in turn the second calls the first. Write two mutually recursive
Continue ReadingBest C++ Books
Reference Style - All Levels A Tour of C++ (Bjarne Stroustrup) The "tour" is a quick (about 180 pages and 14 chapters) tutorial overview of all
Continue ReadingC++: Maximum Triangle Path Sum
Starting from the top of a pyramid of numbers like this, you can walk down going one step on the right or on the left, until you reach the bottom row:
Continue ReadingC++: Fractal Tree
Generate and draw a fractal tree. To draw a fractal tree is simple: Draw the trunk At the end of the trunk, split by some angle and draw tw
Continue Reading




