Compsci 6, Fall 2011, Classwork 16
PRINT Names and NetID of students in group (min 2, max 3)
Name: __________________________ NetID: _____________
Name: __________________________ NetID: _____________
Name: __________________________ NetID: _____________
Problem 1:
Create a map of first names to the number of corresponding last names.
def mapNameToNumberLastNames(countmap, data):
'''
countmap is a map of first names to its number of occurrences
The parameter data is a list of lists where each list is two
strings representing the first and last name of a person.
'''
#todo:
Problem 2:
Create a map of first names to a list of corresponding last names.
def mapNameToLastNames(namemap, data):
'''
namemap is a map of first names to list of corresponding last names
The parameter data is a list of lists where each list is two
strings representing the first and last name of a person.
'''
#todo:
Problem 3:
Create a map of first names to a set of corresponding last names.
def mapNameToSetLastNames(namesetmap, data):
'''
namemap is a map of first names to list of corresponding last names
The parameter data is a list of lists where each list is two
strings representing the first and last name of a person.
'''
#TODO:
Problem 4:
Compute the maximum number of lastnames that correspond to a first
name.
#TODO: Compute maxnum
Problem 5:
Give an algorithm (in words) to solve the EmailsCourse APT problem.