Solve the eight queens puzzle. You can extend the problem to solve the puzzle with a board of side NxN. For the number of solutions for small value
Continue ReadingC++: Delegate Behavior to Derived Classes
INTENT Delegate behavior to derived classes without incurring the cost of run-time polymorphism. DESCRIPTION With the Curiously Recurring Tem
Continue ReadingC++: Binary Search Tree Verification
struct TreeNode { int data; TreeNode *left; TreeNode *right; }; bool isBST(TreeNode *node, int minData, int maxData) { if(node == NULL
Continue ReadingC++: Catalan Numbers
Catalan numbers are a sequence of numbers which can be defined directly: Or recursively: Or alternatively (also recursive):
Continue ReadingC++: Euler Method
Euler's method numerically approximates solutions of first-order ordinary differential equations (ODEs) with a given initial value. It is an explicit
Continue ReadingC++: FizzBuzz
Write a program that prints the integers from 1 to 100. But for multiples of three print "Fizz" instead of the number, and for the multiples of fiv
Continue ReadingC++: Multisplit
It is often necessary to split a string into pieces based on several different (potentially multi-character) separator strings, while still retaining
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++: 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 Reading




