Musings
            Public · Protected · Private
        
        
    Merging point of two linked lists
    
    - 
                    2008-08-09 01:39ProblemStatement: You have two singly linked lists. Both are merging at one point. You are given two root nodes.
 - 
                    2008-08-09 01:44Stack s1 = new Stack(); Stack s2 = new Stack(); node temp = root1; while(temp!= null) S1.Push(temp); temp = root2; while(temp!= null) S2.Push(temp); while(true) { temp = S1.Pop(); if(temp != S2.Pop) { break; } } Answer = temp
 
This blog is frozen. No new comments or edits allowed.