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++: Equilibrium Index
An equilibrium index of a sequence is an index into the sequence such that the sum of elements at lower indices is equal to the sum of elements at hig
Continue ReadingC++: Even or Odd
Test whether an integer is even or odd. There is more than one way to solve this task: Use the even and odd predicates, if the language provid
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




