The definition of the sequence is colloquially described as: Starting with the list [1,1], Take the last number in the list so far: 1, I'll ca
Continue ReadingC++: Matrix Exponentiation Operator
Most programming languages have a built-in implementation of exponentiation for integers and reals only. Demonstrate how to implement matrix expone
Continue ReadingWith C arrays, why is it the case that a[5] == 5[a]?
As Joel points out in Stack Overflow podcast #34, in C Programming Language (aka: K & R), there is mention of this property of arrays in C: a[5] =
Continue ReadingC++: Binary Search Tree Insertion
void insert(Node*& root, int data) { if (!root){ root = new Node(data); } else if (data < root->data){ insert(root->left,
Continue ReadingC++ Code
[pt_view id="e30eb21e03"]
Continue ReadingC++: Create a Two-Dimensional Array at Runtime
Get two integers from the user, then create a two-dimensional array where the two dimensions have the sizes given by those numbers, and which can be a
Continue ReadingC++: Day of the Week
A company decides that whenever Xmas falls on a Sunday they will give their workers all extra paid holidays so that, together with any public holidays
Continue ReadingC++: Single Inheritance
Inheritance is an operation of type algebra that creates a new type from one or several parent types. The obtained type is called derived type. It inh
Continue ReadingC++: Normal PDF
const double Pi = 3.14159265359; // Standard Normal probability density function double Normal_PDF(const double & x) // Normal PDF(x) = e
Continue ReadingC++: File Modification Time
This task will attempt to get and set the modification time of a file. #include <boost/filesystem/operations.hpp> #include <ctime> #i
Continue Reading




