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
{ | |
"basics":{ | |
"name":"Rahul Bhatija", | |
"label":"Software Developer", | |
"image":"https://avatars.githubusercontent.com/u/42683680?v=4", | |
"email":"[email protected]", | |
"phone":"+918700662217", | |
"summary":"2+ years of experience in Software Development using MEAN/MERN Stack. \n \nDeveloped User Interface (UI) applications and professional web applications using HTML,CSS3, Bootstrap, JavaScript, Angular 6, Node JS, React JS, Express JS, Mongo DB, NPM, GIT, JSON, XML.\n \nExtensively worked in various software methodologies such as Agile, and Scrum. \n \nExperience in building applications using Angular, React.JS, Node.JS, Express.JS.", | |
"location": { |
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){ |
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 mergeLists(head1, head2) { | |
var result = new SinglyLinkedListNode(); | |
// case1 | |
if(head1==null){ | |
return head2; | |
}else if(head2==null){ | |
return head1; | |
} |
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 CompareLists(a, b) { | |
while(a!==null && b!==null){ | |
if(a.data !== b.data){ | |
return 0 | |
}else{ | |
a=a.next; | |
b=b.next; | |
} |
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 reversePrint(head) { | |
//recursion is king | |
if(head!==null){ | |
reversePrint(head.next); | |
return console.log(head.data); | |
} | |
} |
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 deleteNode(head, position) { | |
if(position==0){ | |
return head.next | |
} | |
head.next = deleteNode(head.next,position-1) | |
return head; | |
} |
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 insertNodeAtPosition(head, data, position) { | |
var trackedNode = head; | |
var newNode = new SinglyLinkedListNode(data); | |
if(head==null){ | |
head = newNode | |
return head; | |
} |
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
//https://www.hackerrank.com/challenges/insert-a-node-at-the-head-of-a-linked-list/problem?h_r=next-challenge&h_v=zen | |
function insertNodeAtHead(head, data) { | |
var newNode = new SinglyLinkedListNode(data); | |
if(head==null){ | |
head = newNode; | |
return head; | |
}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
// https://www.hackerrank.com/challenges/insert-a-node-at-the-tail-of-a-linked-list/problem | |
function insertNodeAtTail(head, data) { | |
var newNode = new SinglyLinkedListNode(data); | |
if(head===null){ | |
head = newNode; | |
return head; | |
}else{ |
NewerOlder