8
votes
2answers
111 views

Finding the longest Collatz sequence cycle

I wrote a program to calculate Collatz sequences for initial numbers between 1 and a given integer i, then find the one with the largest cycle length. My code is ...
1
vote
1answer
88 views

Can this code that calculates kills and deaths in a game be written to execute faster?

So I'm trying to make a program that calculates your kd ratio(Kill/death, it's used in FPS games to make people belive that it's skill), how many kills you need without dying once to reach a goalKD. ...
0
votes
1answer
91 views

Processing a string from the console

How can I make this program run faster? On enter, I have a string from the console. For example: 1 1 7 3 2 0 0 4 5 5 6 2 1 On exit, it will be ...
8
votes
2answers
4k views

Perfect Hashing Implementation

I'm building a hash table for this problem: Implement a class for storing a set of integers: ...
2
votes
3answers
764 views

How to reduce execution time and compile time of this program?

I have one programming question: The sine and cosine of x can be computed as follows. sin(x) = x - x3/3! + x5/5! - x7/7! - x9/9! + … cos(x) = 1 - x2/2! + x4/4! - x6/6! + x8/8! - ...
1
vote
3answers
216 views

Primes Tester for speed performance

I was given a homework assignment in Java to create classes that find Prime number and etc (you will see in code better). ...
4
votes
3answers
345 views

Nearest Neighbour classification algorithm

The following code is from a university assignment of mine to write a classification algorithm (using nearest neighbour) to classify whether or not a given feature set (each feature is the frequency ...
8
votes
1answer
391 views

Java application for finding permutations efficiently

I am an eighth grader with a school project of creating and application in Java that returns the total permutations of two given numbers. It needs to be light and efficient, for later deployment on a ...
4
votes
2answers
1k views

Cash-withdrawal from an ATM

I'm seeking review comments (design, performance, etc.) based on the problem statement: Write a CashWithDrawal function from an ATM which based on user specified amount dispenses bank notes. ...