Reputation
16,836
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
2 33 67
Newest
 algorithms
Impact
~525k people reached

Dec
13
comment Permutting a list of numbers in order to get a list which satisfies given condition
Because they are the ones closest to all the others, putting them at the ends eliminates one distance from each of them. your method can be improved simply by putting the last number you add to the beginning.
Dec
13
comment Permutting a list of numbers in order to get a list which satisfies given condition
I'd say the beginning and end should contain the 2 middle numbers (the median and number closest to it)
Dec
12
revised Permutting a list of numbers in order to get a list which satisfies given condition
formatting
Dec
12
comment Searching algorithm used in switch statement
@MichaelT then the compiler would just copy the code of case 2 to after case 1 or make it a if cascade with goto endSwitch; for each break.
Dec
12
revised Searching algorithm used in switch statement
added 14 characters in body
Dec
12
answered Searching algorithm used in switch statement
Dec
12
comment Java card game design decision
@userx01 the cursor can have a Stack that holds at most 1 card it gets the card from the Stack under the cursor when mouse down and tries to put down the card on mouse up, resetting if it fails.
Dec
12
answered Java card game design decision
Dec
11
comment Do compilers attach the Garbage Collector to the final executable?
GC is often language specific, there are C++ GC implementations that get included by either a static library or a DLL.
Dec
11
answered Do compilers attach the Garbage Collector to the final executable?
Dec
10
comment Does TCP guarantee packet transmission time?
best effort only, it can't help if the IP layer can't deliver.
Dec
10
comment Is there ever a reason to use an array when lists are available?
@InstructedA in C# it is.
Dec
10
comment Is there ever a reason to use an array when lists are available?
For a hash table you can use an array and when you need to grow the table you need to set the elements to the new positions based on hash%newArray.length anyway.
Dec
10
comment Is there ever a reason to use an array when lists are available?
or until you need to reset the position of all data anyway, like during a rehash of a hashtable.
Dec
10
comment Is there ever a reason to use an array when lists are available?
@Knerd then it's time to create a multidimensional list
Dec
10
comment Is there ever a reason to use an array when lists are available?
@FrustratedWithFormsDesigner they aren't guaranteed to be rectangular
Dec
10
comment Is there ever a reason to use an array when lists are available?
It allows List<T> to not be a built-in type and allows the simpler type T[] (no resizing, only length and data) be the built-in type
Dec
10
comment Is there ever a reason to use an array when lists are available?
To implement List<T>
Dec
10
comment Does a licence exist where forking forces the developer to resell it when developer want to redistribute?
That's not half-open, it's pretty closed+commercial. Just ask a lawyer that knows licenses to write one out.
Dec
10
comment How can I encourage people to read error messages?
Provide a list of most common error messages and the probable cause and fix. Experienced people already know that list by heart.