Andrey Tyukin
  • Member for 6 years, 9 months
  • Last seen more than a month ago
Function that convert decimal to binary
10 votes

If you are using lists of strings to represent sequences of bits, the performance does not seem to matter. So if the performance does not matter anyway, one could at least try to make it as simple as ...

View answer
Greatest Common Factor
2 votes

Use Euclid's algorithm, it's much simpler and much much faster. public static int gcf(int a, int b){ return b == 0 ? a : gcf(b, a % b); }

View answer