[pt_view id="fa2c5f1466"]
Continue ReadingC++: Downward For Loop
Write a for loop which writes a countdown from 10 to 0. for(int i = 10; i >= 0; --i) std::cout << i << "\n"; SOURCE Con
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++: 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++: Catalan Numbers
Catalan numbers are a sequence of numbers which can be defined directly: Or recursively: Or alternatively (also recursive):
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++: 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++: 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 Reading




