What is the time complexity to count the number of elements in the linked list?

Tam ca

New member
What is the time complexity to count the number of elements in the linked list?
A. O(1)
B. O(n)
C. O(logn)
D. O(n$^{2}$)
 

Tìm kiếm

Back
Top