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
Continue ReadingCrash Course in C++
C++ is a systems programming language that, according to its inventor Bjarne Stroustrup, was designed to be a “better C” support data abst
Continue ReadingC++: Abstract Type
Abstract type is a type without instances or without definition. For example in object-oriented programming using some languages, abstract types ca
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 ReadingC++: Matrix Multiplication
Multiply two matrices together. They can be of any dimensions, so long as the number of columns of the first matrix is equal to the number of rows of
Continue ReadingC++ Binary Search Trees
[pt_view id="3a985d76d6"]
Continue ReadingC++: Arithmetic Evaluation
Create a program which parses and evaluates arithmetic expressions. Requirements An abstract-syntax tree (AST) for the expression must
Continue ReadingC++: Modular Inverse
From Wikipedia: In modular arithmetic, the modular multiplicative inverse of an integer a modulo m is an integer x such that
Continue ReadingC++: Least Common Multiple
Compute the least common multiple of two integers. Given m and n, the least common multiple is the smallest positive integer that has both m and n
Continue ReadingC++: Empty Directory
Starting with a path to some directory, determine whether the directory is empty. An empty directory contains no files nor subdirectories. With Uni
Continue Reading