In bioinformatics, long character strings are often encoded in a format called FASTA. A FASTA file can contain several strings, each identified by a n
Continue ReadingC++: Empty String
Languages may have features for dealing specifically with empty strings (those containing no characters). The task is to: Demonstrate how to a
Continue ReadingC++: Huffman Coding
Huffman encoding is a way to assign binary codes to symbols that reduces the overall number of bits used to encode a typical string of those symbols.
Continue ReadingC++: Levenshtein Distance
template <class T> unsigned int edit_distance(const T& s1, const T& s2) { const size_t len1 = s1.size(), len2 = s2.size(); vect
Continue ReadingC++: Longest Common Substring
#include <string> using std::string; int LongestCommonSubstring(const string& str1, const string& str2) { if(str1.empty() |
Continue ReadingC++: Copy a String
This task is about copying a string. Where it is relevant, distinguish between copying the contents of a string versus making an additional reference
Continue ReadingC++: Generate Lower Case ASCII Alphabet
Generate an array, list, lazy sequence, or even an indexable string of all the lower case ASCII characters, from 'a' to 'z'. If the standard librar
Continue ReadingC++: CRC-32
Demonstrate a method of deriving the Cyclic Redundancy Check from within the language. The result should be in accordance with ISO 3309, ITU-T V.42,
Continue ReadingC++: Formatted Numeric Output
Express a number in decimal as a fixed-length string with leading zeros. For example, the number 7.125 could be expressed as "00007.125". #inc
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 Reading