Algorithm Efficiency
•
Here is an example of how to analyze the
efficiency of an algorithm to traverse a
linked list...
void printlist(node *head)
{
node * cur;
cur = head;
while (cur != NULL) {
cout <<cur->data;
cur = cur->link;
}