Skip to content

Instantly share code, notes, and snippets.

View Preetiraj3697's full-sized avatar
🎯
Focusing

Preeti Raj Preetiraj3697

🎯
Focusing
View GitHub Profile
@Preetiraj3697
Preetiraj3697 / getNode.js
Created October 21, 2022 05:41 — forked from rahul4coding/getNode.js
Get node value in a linked list position from tail | JS
function getNode(head, positionFromTail) {
var length =0;
var tp = head;
while(tp!==null){
length++;
tp=tp.next
}
let currentPosition=0;
if(head==null){
@Preetiraj3697
Preetiraj3697 / findMergeNode.js
Created October 21, 2022 05:39 — forked from rahul4coding/findMergeNode.js
Find merge point of two linked list | JS
function findMergeNode(headA, headB) {
let currentA = headA;
let currentB = headB;
while(currentA!==currentB){
//headA
if(currentA.next==null){
currentA.next=headB
}else{
@rahul4coding
rahul4coding / getNode.js
Created December 16, 2019 19:49
Get node value in a linked list position from tail | JS
function getNode(head, positionFromTail) {
var length =0;
var tp = head;
while(tp!==null){
length++;
tp=tp.next
}
let currentPosition=0;
if(head==null){