Click here to Skip to main content
15,897,334 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Intel Integrated Native Developer Experience - INDE - it's an experience all right... Pin
charlieg20-Aug-15 0:29
charlieg20-Aug-15 0:29 
GeneralRe: Intel Integrated Native Developer Experience - INDE - it's an experience all right... Pin
Afzaal Ahmad Zeeshan19-Aug-15 9:32
professionalAfzaal Ahmad Zeeshan19-Aug-15 9:32 
GeneralRe: Intel Integrated Native Developer Experience - INDE - it's an experience all right... Pin
charlieg20-Aug-15 0:39
charlieg20-Aug-15 0:39 
GeneralRe: Intel Integrated Native Developer Experience - INDE - it's an experience all right... PinPopular
Marc Clifton19-Aug-15 9:50
mvaMarc Clifton19-Aug-15 9:50 
GeneralRe: Intel Integrated Native Developer Experience - INDE - it's an experience all right... Pin
PIEBALDconsult19-Aug-15 9:59
mvePIEBALDconsult19-Aug-15 9:59 
GeneralRe: Intel Integrated Native Developer Experience - INDE - it's an experience all right... Pin
Kevin Marois19-Aug-15 10:15
professionalKevin Marois19-Aug-15 10:15 
GeneralRe: Intel Integrated Native Developer Experience - INDE - it's an experience all right... Pin
CPallini19-Aug-15 10:48
mveCPallini19-Aug-15 10:48 
GeneralDoes the typical regular programmer understand HeapSort? Pin
swampwiz19-Aug-15 7:53
swampwiz19-Aug-15 7:53 
(Fresh off my discussion of BubbleSort, I've decided to move on another sort of topic [pun intended].)

It seems to me that there are only 5 really important sorting algorithms, although the others have their place for specific situations. There is BubbleSort (recently discussed) and InsertionSort, the latter of which is typically the best quadratic sort, and that has some use for smaller sizes. And then there are the big 3, QuickSort, MergeSort & HeapSort, which AIUI are generally used for the stable & unstable sorting functions; the unstable one seems to be IntroSort, which generally uses QuickSort, but cleverly figures out if the worst case (or something close) for QuickSort will happen, in which case it does HeapSort instead. My understanding is that QuickSort has the least stochastic expected time, but that it can go to quadratic time for the worst case, and that HeapSort has the fastest worst-case time, but still has a better stochastic expected time than MergeSort, so both are to be preferred, so long as equal-valued entries do not have to be in the same relative order. MergeSort has the least stochastic, and perhaps worst-case time (or at least not too bad of a worst case time), if the relative order of equal-value entries must be preserved, and so is used for stable_sort.

I understand how all of these work, except for HeapSort, which seems to be very complicated. It seems to rely on the fact that the binary heap tree can be automatically mapped to positions in an array, and that comparisons are done between positions that only differ by a single bit, with the result being swapped with the position corresponding to the previous bit. Somehow this simplicity is exploited so that the resultant algorithm is very efficient. I wonder if all but the top algorithm nerds really understand it.
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
PIEBALDconsult19-Aug-15 7:58
mvePIEBALDconsult19-Aug-15 7:58 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
harold aptroot19-Aug-15 8:00
harold aptroot19-Aug-15 8:00 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
OriginalGriff19-Aug-15 8:01
mveOriginalGriff19-Aug-15 8:01 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
CDP180219-Aug-15 9:08
CDP180219-Aug-15 9:08 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
David Days20-Aug-15 3:13
professionalDavid Days20-Aug-15 3:13 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
OriginalGriff20-Aug-15 4:03
mveOriginalGriff20-Aug-15 4:03 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
David Days20-Aug-15 4:11
professionalDavid Days20-Aug-15 4:11 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
CPallini19-Aug-15 9:22
mveCPallini19-Aug-15 9:22 
GeneralRe: Does the typical regular programmer understand HeapSort? PinPopular
R. Giskard Reventlov19-Aug-15 9:56
R. Giskard Reventlov19-Aug-15 9:56 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
Yuriy Loginov19-Aug-15 10:49
professionalYuriy Loginov19-Aug-15 10:49 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
Amarnath S19-Aug-15 16:51
professionalAmarnath S19-Aug-15 16:51 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
Dan Neely20-Aug-15 3:42
Dan Neely20-Aug-15 3:42 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
Super Lloyd19-Aug-15 19:42
Super Lloyd19-Aug-15 19:42 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
grgran20-Aug-15 5:19
grgran20-Aug-15 5:19 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
Walt Karas20-Aug-15 5:37
Walt Karas20-Aug-15 5:37 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
SeattleC++20-Aug-15 6:55
SeattleC++20-Aug-15 6:55 
GeneralRe: Does the typical regular programmer understand HeapSort? Pin
rcampbell1220-Aug-15 8:17
rcampbell1220-Aug-15 8:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   30 votes