The month of October in 2010 has five Fridays, five Saturdays, and five Sundays. The task Write a program to show all months that have this same characteristic of five […]

Continue Reading## C++: 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 five print “Buzz”. […]

Continue Reading## C++: Dijkstra’s Algorithm

Dijkstra’s algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1956 and published in 1959, is a graph search algorithm that solves the single-source shortest path problem for a graph […]

Continue Reading## C++: MD5

Encode a string using an MD5 algorithm. The algorithm can be found on wikipedia. Optionally, validate your implementation by running all of the test values in IETF RFC (1321) for […]

Continue Reading## C++: Move-To-Front Algorithm

Given a symbol table of a zero-indexed array of all possible input symbols this algorithm reversibly transforms a sequence of input symbols into an array of output numbers (indices). The […]

Continue Reading## C++: Bresenham’s Line Algorithm

Using the data storage type defined on this page for raster graphics images, draw a line given 2 points with the Bresenham’s line algorithm. void Line( const float x1, const […]

Continue Reading## C++: Main Step of GOST 28147-89

GOST 28147-89 is a standard symmetric encryption based on a Feistel network. Structure of the algorithm consists of three levels: encryption modes – simple replacement, application range, imposing a range […]

Continue Reading## C++: Execute a Markov Algorithm

Create an interpreter for a Markov Algorithm. Rules have the syntax: <ruleset> ::= ((<comment> | <rule>) <newline>+)* <comment> ::= # {<any character>} <rule> ::= <pattern> <whitespace> -> <whitespace> [.] <replacement> <whitespace> ::= (<tab> | […]

Continue Reading## C++: Evolutionary Algorithm

Starting with: The target string: “METHINKS IT IS LIKE A WEASEL”. An array of random characters chosen from the set of upper-case letters together with the space, and of the […]

Continue Reading## C++: Knuth’s Algorithm S

This is a method of randomly sampling n items from a set of M items, with equal probability; where M >= n and M, the number of items is unknown […]

Continue Reading