A magic square is an square matrix whose numbers (usually integers) consist of consecutive numbers arranged so that the sum of each row and column, a
Continue ReadingC++: Integer Literals
Some programming languages have ways of expressing integer literals in bases other than the normal base ten. Show how integer literals can be expre
Continue ReadingC++: Fibonacci N-Step Number Sequences
These number series are an expansion of the ordinary Fibonacci sequence where: For n = 2 we have the Fibonacci sequence; with initial values [1,1
Continue ReadingC++ Interview Questions
C++ Full Course Lesson 9: Functions
https://www.youtube.com/watch?v=bsWWHo4KDHE&list=PLAE85DE8440AA6B83&index=9
Continue ReadingC++: Fibonacci Word Fractals
The Fibonacci word may be represented as a fractal as described here: For F_wordm start with F_wordCharn=1 Draw a segment forward If curren
Continue ReadingC++: Middle Three Digits
The task is to: “Write a function/procedure/subroutine that is called with an integer value and returns the middle three digits of the integer
Continue ReadingC++: First-Class Functions
A language has first-class functions if it can do each of the following without recursively invoking a compiler or interpreter or otherwise metaprogra
Continue ReadingC++: Hash From Two Arrays
Using two Arrays of equal length, create a Hash object where the elements from one array (the keys) are linked to the elements of the other (the value
Continue ReadingC++: Why is one loop so much slower than two loops?
Suppose a1, b1, c1, and d1 point to heap memory and my numerical code has the following core loop. const int n=100000 for(int j=0;j<n;j++){
Continue Reading