Question: Imagine, CCSF started students' IDs beginning 1 0 0 0 0 . In other words, CCSF gave her very first student the ID , 1

Imagine, CCSF started students' IDs beginning 10000. In other words, CCSF gave her very first student the ID,10000 and the next student 10001 and so on. CCSF stores this student data sequentially in a table as more and more students enroll. Given a single column table of CCSF students IDs as a list, and a given student ID to search, write an algorithm to search for the record (row number of the record) of a student with a given ID.
Do the following:
For simplicity, assume CCSF stores all the ID data sequentially in a list
Workout few examples with a list with few earliest students
Thrive to derive the most efficient algorithm
Write your algorithm as a numbered list as code comments in your program (4 points)
Analyze your algorithm for both the running time and the space (memory). Write your analysis as code comments. You may assume list index access operation takes a constant amount of time. Express your analysis as a function of the length, n of the list. Write it as a code comment in your program. Please watch these videos for how we can do this (4 points).
Implement your algorithm as a Python function named search_id and test it out for the id_list =[10000,10001,10002,10003,10004,10005,10006,10007,10008,10009,10010,10011,10012,10013,10014,10015,10016,10017,10018,10019] for looking up the id,10014 in the main program (2 points). # Below is the standard way we write complete applications in Python. Notice the major components. Please follow inline instructions.
# Below is the standard way we write complete applications in Python. Notice the major components. Please follow inline instructions.
# Import random module below
# Your plan (algorithm) should go below
'''
'''
def search_id(): # You must pass the correct inputs as parameters. Make sure to collect those parameters in your main().
'''Write your function Docstring here''' # Function docstring says what it does.
# Make sure to return your result, don't print
# We use main program to use, test our solution. Sometimes we call it the client or the driver program.
def main():
# collect the input here from the user not from the function.
# Make sure to use a while loop appropriately to call your function as long as user needs
# Code below simply runs the main(). Don't worry we will soon learn about this syntax.
if __name__=="__main__":
# call main() here
# A copy of your output goes below
"""
"""

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!