All Questions
7
questions
5
votes
2
answers
264
views
C# console app that computes the Jaccard Index
So I wrote a basic C# console application that computes the Jaccard Index. This has its applications in cybersecurity and machine learning. Given two sets X and Y, the basic formula is:
$$ J(X, Y) = \...
6
votes
4
answers
263
views
All your Base - Exercism.io
This is an exercise on the website Exercism. I am self taught trying to learn C# and C++. This is the information from the readme.
Convert a number, represented as a sequence of digits in one base,...
4
votes
1
answer
211
views
Rare binary numbers
Rare numbers are the natural numbers in their binary forms in which there aren't two (or more) ones next to each other. Make a program that will give the N. rare number!
For example:
In case of N =...
3
votes
5
answers
2k
views
Absolute Values and Fractions
$$
\frac{|x|-|y|}{1+|xy|}
$$
How can I reduce the amount of code without losing quality? What are your tips? Your comments on the structure, logic, in general, everything. How to make the type of ...
-2
votes
3
answers
180
views
Find target sum of 3 from and array
Input is a sorted array and a target sum. Find all sets of 3 unique elements that sum to a target.
Looking for lowest order (big O).
A, B, C are the indexes on the sorted array. A < B < C
...
7
votes
2
answers
861
views
Optimizing special cases of modulo
I have a use case where improvements to the speed of calculating modulo for 64 bit integer dividends makes a significant difference in overall processing time.
The divisor isn't known statically - it ...
2
votes
2
answers
672
views
Convert a double to a string containing rational and surd
First off, code:
...