The following function, due to D Hickerson, is said to generate "Almost integers" by the "Almost Integer" page of Wolfram Mathworld. (December 31 2013
Continue ReadingC++ vs Python: 1 Hour Pong Challenge
https://www.youtube.com/watch?v=v0lAdyhgqio
Continue ReadingC++: Knuth Shuffle
Implement the Knuth shuffle (a.k.a. the Fisher-Yates shuffle) for an integer array (or, if possible, an array of any type). The Knuth shuffle is used
Continue ReadingC++: Bounded Knapsack Problem
A tourist wants to make a good trip at the weekend with his friends. They will go to the mountains to see the wonders of nature. So he needs some item
Continue ReadingC++: Harshad/Niven Series
The Harshad or Niven numbers are positive integers >= 1 that are divisible by the sum of their digits. For example, 42 is a Harshad number as 42
Continue ReadingC++: Generic Swap
The task is to write a generic swap function or operator which exchanges the values of two variables (or, more generally, any two storage places that
Continue ReadingC++: Determine if a String Is Numeric
Create a boolean function which takes in a string and tells whether it is a numeric string (floating point and negative numbers included) in the synta
Continue ReadingC++: Closures/Value Capture
Task: Create a list of 10 functions, in the simplest manner possible (anonymous functions are encouraged), such that the function at index i (you may
Continue ReadingC++: Calendar
Create a routine that will generate a text calendar for any year. Test the calendar by generating a calendar for the year 1969, on a device of the tim
Continue ReadingC++: AVL Tree
In computer science, an AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by a
Continue Reading




