+ 4
If you're using a built-in linked list make a method with a return type of int that takes a parameter of LinkedList. Then all you'd need to do in the method is return LinkedList.size(). Otherwise you'd need to loop over the elements of the LinkedList and increment a counter for each element. Then return the counter.
10th Nov 2020, 6:47 PM
ChaoticDawg
ChaoticDawg - avatar