Computers and Technology
You have been assigned to design and implement a data structure that will be used to store and retrieve student records. The data structure should be able to store the following information for each student: name, ID number, major, and GPA. You are required to use array, linked list, and stack in the implementation of this data structure using python. 1. Design the Data Structure: a. Decide on the format for storing student records. b. Choose the data types for each field (name, ID number, major, and GPA). c. Determine the operations that the data structure should support (insert, delete, search). d. Choose the appropriate data structure for each operation (array, linked list, or stack). e. Create a diagram to show how the different data structures will be used together. 2. Implement the Data Structure: a. Implement each data structure to store the students records. b. Write functions to insert, delete, and search student records. 3. Test the Implementation: a. Write a test function to insert several student records into the data structure. b. Write a test function to delete some of the records. c. Write a test function to search for a specific record. d. Verify that the data structure is working correctly by running the test functions.
Kelly has a magic pot which can slowly cook one ingredient into others. She already mastered the cooking techniques and concludes that the process can be modeled using markov chain represented by a transition matrix A. You are given the ingredient list material_list = ["snake oil", "silver", "caviar", "bones", "uranium", "plutonium"] which corresponds to the rows and columns order of A. Each entry Aij of A represents the fraction of the jt ingredient of material_list that will turn into the the ingredient per minute without losing any mass. One day Kelly started making some of her magical soup and after a few minutes she realized she forgot to start the timer. She could not remember the time she started cooking, or even the ingredient composition of her initial soup. She can only recall that at the beginning of the cooking, (35+ 0. 1)% of the mass of all materials is snake oil. In fear of ruining her precious ingredients, she immediately casts a spell to determine the current composition of the soup and stores it in the vector comp, where each entry is the fraction in terms of mass of each ingredient, following the order in material_list. Write a code snippet to help Kelly with the following: 1. Use the current ingredient composition given in comp to determine the initial ingredient composition. Store in the variable initial_frac the initial fraction of the ingredient bones. 2. Suppose Kelly decides to leave the soup cooking for a very long time, until the ingredient composition in the pot is no longer changing. Help her determine this final ingredient composition and store it in the vector final_comp, where each entry is the fraction in terms of mass of each ingredient, following the order in material_list. The setup code will provide the following variables: The setup code will provide the following variables: A Name Type Description 2d numpy array transition matrix material_list Python list names of the ingredients comp 1d numpy array composition of the ingredients in the pot Your code snippet should define the following variables: Name initial_frac final_comp Type float 1d numpy array Description initial fraction of bones in terms of mass final ingredient composition