Computer Science 269
Introduction to Data Structures
Fall 2000
Practice Programming Assignment 1.
Counting the elements in a linked list.
-
Implement a linked list where the items are integers.
For example, you could start with this,
but you could do it a different way.
-
Write a function which counts the items in a linked list.
The prototype of your function should be extremely simple. For example:
int listcount(list);
-
Write two versions: one using recursion, the other non-recursive using
a loop with a running pointer.