Reputation
389
Top tag
Next privilege 500 Rep.
Access review queues
Badges
1 2 13
Newest
 Informed
Impact
~24k people reached

  • 0 posts edited
  • 0 helpful flags
  • 7 votes cast
1d
revised What algorithm would have the fastest average run time and least memory requirements for sorting a deck of playing cards?
Clarified details as requested in comments.
1d
comment What algorithm would have the fastest average run time and least memory requirements for sorting a deck of playing cards?
@PieterB No, the original question talks about N cards. The reason I'm asking is because I'm interested in algorithms, not because I don't know how to sort a deck of cards "fast enough" for most cases. That would be all about new Deck(); :P.
1d
comment What algorithm would have the fastest average run time and least memory requirements for sorting a deck of playing cards?
@CodesInChaos Yes achieving a sorted deck in software is trivial, but my question is about sorting algorithms. What if we were designing software to produce a list of steps to sort a physical deck?
1d
comment What algorithm would have the fastest average run time and least memory requirements for sorting a deck of playing cards?
@PieterB What if you have an extremely slow computer, for instance, a mechanical one? What if it's a physical deck being sorted by robots? N doesn't have to be small - in the most general case N could be arbitrarily large, even in the millions.
1d
asked What algorithm would have the fastest average run time and least memory requirements for sorting a deck of playing cards?
Dec
3
awarded  Informed
May
4
awarded  Famous Question
Feb
2
comment Where can I get a diverse set of sample text?
@YannisRizos This was closed a few years ago. I finally got around to editing the question so that it's a little more specific and better for QA format. Can I get it un-closed now? (You're the only person on this thread who's still a moderator).
Feb
2
revised Where can I get a diverse set of sample text?
Updated question to better adhere to QA guidelines.
Apr
25
awarded  Nice Question
Nov
8
awarded  Notable Question
May
10
awarded  Popular Question
Jan
11
awarded  Popular Question
Dec
14
awarded  Yearling
Jun
8
awarded  Caucus
Apr
27
awarded  Nice Question
Apr
27
comment Is it inefficient to concatenate strings one at a time?
I don't care about language for the purpose of this question. The use of stringbuilder behind the scenes in some languages explains why it may not be inefficient to concatenate an entire list of strings, which answers my question. This answer did however explain that joining a list could potentially be hazardous, and recommended stringbuilder as an alternative. I recommend adding the compiler's use of stringbuilder behind the scenes to your answer, in order to avoid possible reputation loss or misinterpretation.
Apr
27
accepted Is it inefficient to concatenate strings one at a time?
Apr
27
comment Is it inefficient to concatenate strings one at a time?
@Caleb Oh yea I always thought malloc was doing some type of OS memory request behind the scenes, but that makes a lot more sense as I also recall that the OS pages a bunch of memory for each application which can be used up and re-sized.
Apr
27
comment Is it inefficient to concatenate strings one at a time?
@Caleb The OS is involved in ALL memory allocation. Failing to follow this rule is a type of memory leak. The exception is when you have hard-coded strings in the application; those get written as binary data within the generated assembly. But as soon as you manipulate (or perhaps even assign) a string it needs to be stored in memory (that is, memory must be allocated).