Table of Contents generated with DocToc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getNode(head, positionFromTail) { | |
var length =0; | |
var tp = head; | |
while(tp!==null){ | |
length++; | |
tp=tp.next | |
} | |
let currentPosition=0; | |
if(head==null){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findMergeNode(headA, headB) { | |
let currentA = headA; | |
let currentB = headB; | |
while(currentA!==currentB){ | |
//headA | |
if(currentA.next==null){ | |
currentA.next=headB | |
}else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getNode(head, positionFromTail) { | |
var length =0; | |
var tp = head; | |
while(tp!==null){ | |
length++; | |
tp=tp.next | |
} | |
let currentPosition=0; | |
if(head==null){ |