
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Given the following C/C++ pseudo code.
struct List { int val; struct List* next; }; int count (struct List* head) { if (head == NULL) return 0; t = count(head->next); return 1 + t; }
int main() { struct List* mylist; mylist = new struct List(); mylist->next = new struct List(); mylist->val = mylist->next->val = 0; int len = count(mylist); printf("len = %d", len); }