We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
this.insert=function(head,data){//complete this methodif(head==null){return{data:data,next:null}}letcurr=headwhile(curr!==null){if(curr.next==null){letnewnode={data:data,next:null}curr.next=newnodebreak}curr=curr.next}returnhead};
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 15: Linked List
You are viewing a single comment's thread. Return to all comments →
javascript solution: