Click here to Skip to main content
15,903,201 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
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 
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 
I went back for a grad degree in CS (starting my third career), and the instructor in algorithms was a complete coding hard-ass--for which I am eternally grateful.

I didn't get my full degree (need a "real" job), but within two years I found the perfect business case for a Heap Sort, and it's been a life saver.

Situation: Need to perform team assignments to incoming records. Along with multiple assignment criteria, the final assignment should be to the guy/gal with the least number of current assignments. Need to process thousands of new team assignments at a time, and make it work out equitably in the end.

Solution: Create a MinHeap to hold each pool of candidates. When a team assignment comes in, pull top (meaning least-assigned) member from each pool, increment their counter, then throw them back into their MinHeap. The MinHeap takes care of keeping the pools organized.

I pretty much took publicly available code, abstracted out the array type, and changed the comparator to be defaulted to min but alterable. That way I can reverse the whole process and add other sorting capabilities if I ever need to.

It's only one use-case, but I've been using it over and over, with only minor modifications, if any. Resorting the entire pool (and having to select different sorting criteria every time) would have slowed the process down quite a bit. Probably not enough for a human to really notice, but I wanted the simplest maintenance arrangement that I could come up with.
vuolsi così colà dove si puote
ciò che si vuole, e più non dimandare
--The answer to Minos and any question of "Why are we doing it this way?"

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 
GeneralStupid Recruiters - Part Whatever Pin
Kevin Marois19-Aug-15 6:18
professionalKevin Marois19-Aug-15 6:18 
GeneralRe: Stupid Recruiters - Part Whatever Pin
MacSpudster19-Aug-15 6:23
professionalMacSpudster19-Aug-15 6:23 
GeneralRe: Stupid Recruiters - Part Whatever Pin
R. Giskard Reventlov19-Aug-15 6:28
R. Giskard Reventlov19-Aug-15 6:28 
GeneralRe: Stupid Recruiters - Part Whatever Pin
Rob Philpott19-Aug-15 6:50
Rob Philpott19-Aug-15 6:50 
GeneralRe: Stupid Recruiters - Part Whatever Pin
Slacker00719-Aug-15 7:42
professionalSlacker00719-Aug-15 7:42 

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.