
Implement a function that counts how many nodes are chained together in a singly linked list.
list_node_count(NULL)Expected result
0For your own tracking. Tests grade your code.
list_node_count(head) // list: A -> B -> C -> NULLExpected result
3list_node_count(head) // list: X -> NULLExpected result
1Expected files
list_node_count.cAllowed functions
None. Write every helper yourself.
Allowed headers

Implement a function that counts how many nodes are chained together in a singly linked list.
list_node_count(NULL)Expected result
0For your own tracking. Tests grade your code.
list_node_count(head) // list: A -> B -> C -> NULLExpected result
3list_node_count(head) // list: X -> NULLExpected result
1Expected files
list_node_count.cAllowed functions
None. Write every helper yourself.
Allowed headers

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.
v0.40: Create exercises. Challenge the community.
Meet Studio →