Let L be a linked list (as defined in Example 5.15). Prove by structural induction on L that length(L) returns the number of elements contained in L. (See Figure 5.37 for the algorithm.)
Figure 5.37: Two algorithms on linked lists.
Example 5.15
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here