Euler's method numerically approximates solutions of first-order ordinary differential equations (ODEs) with a given initial value. It is an explicit
Continue ReadingC++: Catalan Numbers
Catalan numbers are a sequence of numbers which can be defined directly: Or recursively: Or alternatively (also recursive):
Continue ReadingC++: Iterated Digits Squaring
If you add the square of the digits of a Natural number (an integer bigger than zero), you always end with either 1 or 89: 15 -> 26 -> 40 ->
Continue ReadingC++: Generate Random Number in Range
int random_in_range(int a, int b) //Function that returns a random integer between 2 provided integers { return a + random() % (b-a+1); }
Continue ReadingC++: Fast Fourier Transform
The purpose of this task is to calculate the FFT (Fast Fourier Transform) of an input sequence. The most general case allows for complex numbers at t
Continue ReadingC++: Determine if Only One Instance Is Running
This task is to determine if there is only one instance of an application running. If the program discovers that an instance of it is already running,
Continue ReadingC++: Find Common Directory Path
Create a routine that, given a set of strings representing directory paths and a single character directory separator, will return a string representi
Continue ReadingC++: Create an Object at a Given Address
In systems programing it is sometimes required to place language objects at specific memory locations, like I/O registers, hardware interrupt vectors
Continue ReadingC++: Constrained Random Points on a Circle
Generate 100 <x,y> coordinate pairs such that x and y are integers sampled from the uniform distribution with the condition that . Then display/
Continue ReadingC++: Split a string in C++
What’s the most elegant way to split a string in C++? The string can be assumed to be composed of words separated by whitespace. (Note that I’m
Continue Reading




