• + 0 comments

    javascript solution:

    function reversePrint(llist) {
        // Write your code here
        let head = llist, previous = null
        if(head == null) return;
        
        while(head){
            let tempnode = head.next 
            head.next = previous 
            previous = head 
            head = tempnode 
        }
    
        while(previous){
            console.log(previous.data)
            previous = previous.next
        }
        
    }