Solving "Print the Elements of a Linked List" from Hacker Rank ( Easy ) - Problem solving in JS

Опубликовано: 28 Сентябрь 2024
на канале: Rowadz
716
12

Recursive solution:
function printLinkedList(head) {
if(!head) return;
console.log(head.data);
printLinkedList(head.next);
}

I'm solving this problem in JS

https://www.hackerrank.com/challenges...

* It's just a way for me to keep solving questions... *

My Profile :

https://www.hackerrank.com/rowad