Counting sort

Counting sort in an \(O\left(n+m\right)\) sorting algorithm (instead of the usual \(O\left(n\log n\right)\)) for integer values, where \(n\) is the number of elements to sort and \(m\) is the width of the data type (e.g., \(2^{8}\) for byte). Its premise is quite simple. Given enough memory, it creates an array the width of the data […]

Counting sort Read More »

Distributed statistics

Whether threading an application or using distributed means, computing basics statistics becomes a bit more challenging. In the post (which I’ll update), I’ll break-down basic statistical functions for implementation in a distributed environment. Contents: Count Maximum Minimum Sum Average Variance Covariance Pearson Correlation Coefficient

Distributed statistics Read More »

Command line reader

While appearing “old-fashioned,” command line programs still exist and are quite useful. In this post, I will share my little command line reader, which provides a few simple readers. It accepts prompt text and handles plaintext and password entry. While the former is quite simple, the latter requires a little background to avoid common mistakes.

Command line reader Read More »

Enums

Enumerators are a commonly used data type to map a value to a predefined set of constants. As the data are entered, an integer iterator enumerates the values beginning with 0 in a plus 1 fashion. You can perform if-then-else style operations on enums using switch statements. Furthermore, it is possible to assign additional values

Enums Read More »

Threads

A Java Thread allows for segmentation and parallelization of a task. If using a single machine, threading is a natural option to boost performance. For instance, a quad-core, hyper-threaded computer can support up to 8 threads (though I’d recommend leaving 1 for the system, so 7 max). Each cluster node in contains 32 threads, so

Threads Read More »

Permutations

Generating permutations can be quite tedious, especially when the number is large. The traditional way is to instantiate all at once, then retrieve each when needed. This, however, requires vast quantities of memory for very large sets, thus making them impractical in most research settings. For example, let the character set be the English alphabet

Permutations Read More »