CSE 116 - Fall 2006 - Introduction to Computer Science for Majors II |
|
Exam 2 Sample Questions
Write Visitors on the LRStruct for each of the operations described(Note: I may or may not post the answers to these problems. However, if you want to check your solutions, you can code them up and write a testing program to ensure their accuracy.)
Returns the string representation of the list (covered in class and recitation)
Returns the length of the list (covered in recitation)
Return the nth element of a list (covered in recitation)
Find the first occurrence of x in the list and delete it (covered in recitation)
Similar to the one above, but deletes all occurrences of x in the list.
Works only on lists of numbers and returns the sum of all of the elements in the list.
Works only on lists of elements that can be compared (see
Works only on lists of Integers and returns a new list of all elements from the original list that are even.
Returns a new list that has all of the elements of the original list, but in reverse order. Other things to know for the test:
|
Announcements | Labs | Meetings | People | Resources | Schedule | Syllabus |
Last modified: Wed Nov 1 09:20:47 2006 |