• + 0 comments

    JavaScript Solution:

    function reversePrint(llist) {
        // Write your code here
        if (llist == null) return;
        let current = llist;
        let stack = [];
        while (current) {
            stack.push(current);
            current = current.next
        }
        while (stack.length > 0) {
            console.log(stack.pop().data);
        }
    }