Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
A common questions that comes up in coding interviews is to count the number of items in the linked list. Now most list libraries have away to get the size but this cannot be used in a interview.
Here is a simple linked list implementation that has two functions First which returns the head and Add that adds a new node to the end of the list.
Solution
Originally published at harrisonbrock.com.
Count Items In Linked List was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.