Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. Suppose you are involved in designing a system that must maintain information about a large number of individuals (for example, customer records or health
3. Suppose you are involved in designing a system that must maintain information about a large number of individuals (for example, customer records or health records). Each person will be represented with an object that contains all of their critical information. Your job is to design a container class to hold all of these records. The following operations must be supported: add (person) - adds person object to the collection remove (name) - removes the person named name from the collection. lookup (name) - returns the record for the person named name. list_all - returns a list of all the records in the collection in order by name. For each of the following ways of organizing the data, give an analysis of the efficiency of the above operations. You should justify each of your analyses with a sentence or two explaining the algorithm that would achieve that efficiency. Try to come up with the best approach for each organizational strategy. (a) The objects are stored in a Python list in the order that they are added. (b) The objects are stored in a Python list in order by name. (c) The objects are stored in a Python dictionary indexed by name
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started