warren

Calgary, Canada

Age: 28

I am a java programmer and a philosopher. Nothing annoys/interests me more than a problem I can't solve. I also like video games.

Aug
25
answered Fast stable sort for small arrays (under 32 or 64 elements)
Aug
25
comment In Java, Struggling with returning a color
There seems maybe a fundamental error here? You have two constructors for an enum and neither of them is a convenience constructor for the other. This is setting off alarm bells in my brain. Set all your fields to final and see if you expose any new errors.
Aug
25
comment Represent a number as a sum of a subset of an array
My second solution as outlined is literally the exhaustive search. It may take a long time, but if you want guarantee, it is right there above this comment.
Aug
25
awarded Autobiographer
Aug
25
answered Fastest way to sort 10 numbers? (numbers are 32 bit)
Aug
25
comment Represent a number as a sum of a subset of an array
canAdd is testing if element i can be added. For the purposes of this problem, if K==4, it searches for two other elements already in the list (a,b) such that a+b+i==S as if a+b+i==S, i cannot be legally added.
Aug
25
comment Codechef "Primality Test" Wrong answer
I may not be familiar with codechef, but sieves only work for lists of consecutive numbers.
Aug
25
comment Factor table algorithm with complexity O(n·sqrt(n))
IIRC, if f(x) is O(n log (n)) then f(x) is also O(n^1.5).
Aug
25
answered Represent a number as a sum of a subset of an array
Aug
25
answered Factor table algorithm with complexity O(n·sqrt(n))
Aug
24
answered to generate random permutation of a array in O(n) time and O(1) space
Aug
24
comment Permutation in graphs
I cannot think of a complete solution, In particular, I cannot see how the author manages to calculate out exactly n variants of a given solution, but the graph referred to in part B is probably the best friends directed graph which is the logical place to start at for finding a solution (for each node with more than one incoming arrow, subtract the extra from the max number satisfiable count (as only one gets to stand to the right)).
Aug
24
answered Bitwise Operation to check string is unique
Aug
24
revised Effort Required to make 3D Game Engine?
spelling, grammar
Aug
24
answered Effort Required to make 3D Game Engine?
Aug
22
comment Effort Required to make 3D Game Engine?
You ask for a large answer. This site is for specific problems in general. Some of the sister sites might be more appropriate for a theory question. Short answer: It varies dramatically. Shooter? Strategy? Puzzle? The basic parts are: hardware rendering engine, game logic modules, user interface, sound engine, network module (multiplayer only), artist services and editors. Support software varies even more.
Aug
22
revised How to optimise finding factors of a factorial
wrong word
Aug
22
revised How to optimise finding factors of a factorial
Better conform to the question.
Aug
22
answered How to optimise finding factors of a factorial
Aug
22
comment How to optimise finding factors of a factorial
I am confused by your pseudocode. You do nothing if the term in the factorial expansion is not prime, and you count up sum(n/x,n/x^2,n/x^3...)) if it is prime, and multiply the answer by one more than that. I simply cannot see how that relates to prime factorization, or any kind of factorization that I know of. Could you clarify what you are doing?
1 2 3 4 5