Click here to Skip to main content
15,920,438 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: Saturday programming challenge Pin
harold aptroot15-Nov-14 12:04
harold aptroot15-Nov-14 12:04 
GeneralRe: Saturday programming challenge Pin
Jörgen Andersson15-Nov-14 12:15
professionalJörgen Andersson15-Nov-14 12:15 
GeneralRe: Saturday programming challenge Pin
harold aptroot15-Nov-14 12:26
harold aptroot15-Nov-14 12:26 
GeneralRe: Saturday programming challenge Pin
PIEBALDconsult15-Nov-14 14:12
mvePIEBALDconsult15-Nov-14 14:12 
GeneralRe: Saturday programming challenge Pin
BillWoodruff15-Nov-14 16:56
professionalBillWoodruff15-Nov-14 16:56 
GeneralRe: Saturday programming challenge Pin
Jörgen Andersson15-Nov-14 19:31
professionalJörgen Andersson15-Nov-14 19:31 
GeneralRe: Saturday programming challenge Pin
PIEBALDconsult15-Nov-14 19:58
mvePIEBALDconsult15-Nov-14 19:58 
GeneralRe: Saturday programming challenge Pin
Jörgen Andersson16-Nov-14 9:02
professionalJörgen Andersson16-Nov-14 9:02 
My idea was to use linked lists.
First create a dictionary for caching the nodes.
Create a linked list for every node in the ParameterCollection, check if the parentnode exists in the dictionary otherwise create it, and AddFirst() to the LinkedList. This way you get it sorted in the right direction.
Then create a collection of enumerators for these LinkedLists and enumerate them until they don't point to the same object anymore. The last common object is the LCA.

An other way is to do it already in SQL, but that's a bit quirkier. I made a tip on that subject a couple of years ago
Wrong is evil and must be defeated. - Jeff Ello
Any organization is like a tree full of monkeys. The monkeys on top look down and see a tree full of smiling faces. The monkeys on the bottom look up and see nothing but assholes.

GeneralRe: Saturday programming challenge Pin
PIEBALDconsult16-Nov-14 10:21
mvePIEBALDconsult16-Nov-14 10:21 
GeneralRe: Saturday programming challenge Pin
Jörgen Andersson16-Nov-14 11:33
professionalJörgen Andersson16-Nov-14 11:33 
GeneralRe: Saturday programming challenge Pin
PIEBALDconsult16-Nov-14 11:55
mvePIEBALDconsult16-Nov-14 11:55 
GeneralRe: Saturday programming challenge Pin
PIEBALDconsult16-Nov-14 16:37
mvePIEBALDconsult16-Nov-14 16:37 
GeneralRe: Saturday programming challenge Pin
Jörgen Andersson16-Nov-14 20:29
professionalJörgen Andersson16-Nov-14 20:29 
GeneralRe: Saturday programming challenge Pin
PIEBALDconsult17-Nov-14 4:05
mvePIEBALDconsult17-Nov-14 4:05 
GeneralRe: Saturday programming challenge Pin
PIEBALDconsult17-Nov-14 13:28
mvePIEBALDconsult17-Nov-14 13:28 
GeneralRe: Saturday programming challenge Pin
PIEBALDconsult16-Nov-14 13:57
mvePIEBALDconsult16-Nov-14 13:57 
GeneralRe: Saturday programming challenge Pin
Jörgen Andersson16-Nov-14 20:20
professionalJörgen Andersson16-Nov-14 20:20 
GeneralRe: Saturday programming challenge Pin
Michael Sisco17-Nov-14 7:14
Michael Sisco17-Nov-14 7:14 
GeneralRe: Saturday programming challenge Pin
Jörgen Andersson17-Nov-14 8:59
professionalJörgen Andersson17-Nov-14 8:59 
JokeNew Tattoo Pin
Mike Hankey15-Nov-14 10:25
mveMike Hankey15-Nov-14 10:25 
GeneralRe: New Tattoo Pin
Oso Oluwafemi Ebenezer17-Nov-14 3:55
Oso Oluwafemi Ebenezer17-Nov-14 3:55 
GeneralRe: New Tattoo Pin
PhilLenoir17-Nov-14 4:33
professionalPhilLenoir17-Nov-14 4:33 
GeneralRe: New Tattoo Pin
Oso Oluwafemi Ebenezer17-Nov-14 5:09
Oso Oluwafemi Ebenezer17-Nov-14 5:09 
GeneralRe: New Tattoo Pin
Gary R. Wheeler21-Nov-14 12:56
Gary R. Wheeler21-Nov-14 12:56 
Generalfrom flippin' at the Golden Arches to Twitch super-star and Red-Bull-Boy Pin
BillWoodruff15-Nov-14 7:27
professionalBillWoodruff15-Nov-14 7:27 

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.