Morwenn
Reputation
603
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
1 5 17
Newest
Impact
~32k people reached

• 1 helpful flag
• 112 votes cast

# 94 Actions

 Oct 5 comment Optimal fixed-size sequential sorting algorithms Oh, and I almost forgot, but amongst what I was trying to achieve, I wanted an « optimal » sort to have an optimal number of assignments, whatever the input. While the number of comparisons will depend on how we look at the input, I believe that there is an optimal number of assignments for every input, no matter how we analyze it. Oct 5 comment Optimal fixed-size sequential sorting algorithms @rwong I delibrately chose to ignore the hardware problem for the question (hence the no parallel stuff) knowing that it makes basically everything harder to reason about :) Oct 5 comment Optimal fixed-size sequential sorting algorithms @rwong Yeah, I know about partially sorted data, I've recently designed a sorting algorithms along the lines of TimSort specially for those :p My point about optimal sorting networks wasn't that optimal sorting networks didn't exist but that they do not produce optimal sorting algorithms: the three values sort that I have provided for example always does less work than an optimal sorting network of size 3. Oct 5 comment Optimal fixed-size sequential sorting algorithms Well, I get your point. I guess that I was going for the kind of « optimal » which gets the least work done, like checking first if the collection is sorted, and don't move anything if it is. But my premises seem to be wrong then (and my English is becoming brittle...). And you're right about equality cases. I totally failed to take those into account. Oct 5 asked Optimal fixed-size sequential sorting algorithms Jun 20 awarded Popular Question May 29 awarded Citizen Patrol May 28 reviewed Reviewed const reference and const pointer. How do they work? May 27 comment Why can't there be any implicit conversions? The Zen of Python, second principle: Explicit is better than implicit. May 6 comment Intersection of geometric entities If I understand correctly, the problem with your solution is that it only works when the result of the intersection is a set a points. However, an intersection between two lines can return a point, a line or nothing. Bottom line: the result can be a set of widely different shapes, so an array of one type can't do it :/ May 6 comment Intersection of geometric entities Exceptions are brutally slow except when not called. In one of the examples, I returned the most case and threw the "exceptional" ones which are statistically brutally uncommon, so the speed should not have been a problem. I wouldn't choose the exceptions for other reasons, though :) May 6 revised Intersection of geometric entities Time machine note. Feb 20 comment Why are there so few C compilers? That's implementation-defined behaviour, not undefined behaviour. Feb 19 comment Why are there so few C compilers? @Leushenko MSVC isn't permanently stuck in C89. There have been some discussions and more C99 features should be added. For starters, most of the C99 library is supported as of MSVC 2015 and a few language features too (mainly the things needed for C++11 though). Feb 12 awarded Yearling Jan 26 revised Is the 'finally' portion of a 'try … catch … finally' construct even necessary? Improved formatting. Jan 26 comment Is the 'finally' portion of a 'try … catch … finally' construct even necessary? It may be useful to note that destructors help with cleaning resources when destruction is deterministic. If we don't know when the object will be destructed and/or garbage-collected, then destructors are not safe enough. Jan 26 suggested approved edit on Is the 'finally' portion of a 'try … catch … finally' construct even necessary? Jan 2 comment Is there a conventional way to combine file path strings? @jpmc26 Also, it's worth noting that Python 3.4 introduced a new `pathlib` module to give a more OO feel to the old `os.path`. Nov 7 awarded Famous Question