Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Problem Statement A Bank employee need your help to manage the details of customer. As few of the Bank customers holds the debit &

1. Problem Statement A Bank employee need your help to manage the details of customer. As few of the Bank customers holds the debit & credit cards, they want to maintain all the stuff. Let us help the employee in one section of it by performing some operations on Debit card i.e., deleting the expired card details and updating few customer details in the system etc. For that we need to have customerID details of that bank along with that we need to check the debit card year of expiry details in this problem statement, so customerID and year of expiry of that associated debit card details are given as input values. By using above details construct a binary tree by using linked list representation where each node should consist of customerID and year of expiry as inputs Let us do the operations on the debit card data of the customer: 1. List out the CustomerID & debit card year of expiry details? 2. List out all the customer details with debit card Year of expiry less than 5 years to the current year and delete each node one by one? 3. Check and list out the debit card year of expiry with greater than current year? 4. Check and list out the year of expiry In between 2019 to 2023 and update them by incrementing each year of that node with 13? 5. Print a new list of customer details with updated years of all the nodes? 6. Print the list of updated customer details in the In-order Traversal? Requirements: 1. Implement the above problem statement as a binary Tree using Linked List and in Python 3.7. 2. Read the input from a file inputPS10.txt. 3. You will output your answers to a file outputPS10.txt 4. Perform an analysis for the features above and give the running time in terms of input size: n. 5. If you were to use a different data structure, which would be the most ideal data structure to replace a general tree such that the overall time complexity is the least. Sample file formats Sample Input file : Each row will have one CustomerId followed by the Year of expiry data separated by a comma. The input file name must be called inputPS10.txt.

Sample inputPS10.txt CustomerID, Year of Expiry 61015, 2021 10987, 2020 11986, 2028 90673, 2035 48058, 2023 39009, 2016 76109, 2009 99013, 2015 46976, 2022 19822, 2036 34590, 2037 55628, 2028 10972, 2020 22091, 2014 29019, 2022 18654, 2020 19753, 2021 81456, 2022 60709, 2021

Sample outputPS10.txt file These are the total of X number of customers CustomerID, Year of Expiry 61015, 2021 10987, 2020 11986, 2028 90673, 2035 48058, 2023 39009, 2016 76109, 2009 99013, 2015 46976, 2022 19822, 2036 34590, 2037 55628, 2028 10972, 2020 22091, 2014 29019, 2022 18654, 2020 19753, 2021 81456, 2022 60709, 2021 Customer Details with Year of expiry < 5 years to the current year 39009, 2016 76109, 2009 99013, 2015 22091, 2014 Deleted node with customer ID: 39009 Deleted node with customer ID: 76109 Deleted node with customer ID: 99013 Deleted node with customer ID: 22091 Customer Details with Year of expiry > current year 11986, 2028 90673, 2035 48058, 2023 19822, 2036 34590, 2037 55628, 2028 Customer Details with Year of expiry in between 2019 and 2023 years 61015, 2021 10987, 2020 46976, 2022 10972, 2020 29019, 2022 18654, 2020 19753, 2021 81456, 2022 60709, 2021 Updated the customer ID 61015 by incrementing 13 years to the year of expiry 61015, 2034 Updated the customer ID 10987 by incrementing 13 years to the year of expiry 10987, 2033 Updated the customer ID 46976 by incrementing 13 years to the year of expiry 46976, 2035 Updated the customer ID 10972 by incrementing 13 years to the year of expiry 10972, 2033 Updated the customer ID 29019 by incrementing 13 years to the year of expiry 29019, 2035 Updated the customer ID 18654 by incrementing 13 years to the year of expiry 18654, 2033 Updated the customer ID 19753 by incrementing 13 years to the year of expiry 19753, 2034 Updated the customer ID 81456 by incrementing 13 years to the year of expiry 81456, 2035 Updated the customer ID 60709 by incrementing 13 years to the year of expiry 60709, 2034 List of Updated customer Details: 61015, 2034 10987, 2033 11986, 2028 90673, 2035 48058, 2023 46976, 2035 19822, 2036 34590, 2037 55628, 2028 10972, 2033 29019, 2035 18654, 2033 19753, 2034 81456, 2035 60709, 2034 In order traversal list of updated customer details: 10972, 2033 10987, 2033 11986, 2028 18654, 2033 19753, 2034 29019, 2035 34590, 2037 46976, 2035 48058, 2023 55628, 2028 60709, 2034 61015, 2034 81456, 2035 90673, 2035

Note that the input/output data shown here is only for understanding and testing, the actual file used for evaluation will be different. 2. Deliverables 1. PDF document designPS10_.pdf detailing your design approach and time complexity of the algorithm and alternate solutions. 2. [Group id] _Contribution.xlsx mentioning the contribution of each student in terms of percentage of work done. Columns must be Student Registration Number, Name, Percentage of contribution out of 100%. If a student did not contribute at all, it will be 0%, if all contributed then 100% for all. 3. inputPS10.txt file used for testing 4. outputPS10.txt file generated while testing 5. .py file containing the python code. Create a single *.py file for code. Do not fragment your code into multiple files. 6. Zip all of the above files including the design document in a folder with the name: a. [Group id] _A1_PS10.zip and submit the zipped file. b. Group Id should be given as Gxxx where xxx is your group number. For example, if your group is 26, then you will enter G026 as your group id. 3. Instructions 1. It is compulsory to make use of the data structure(s) / algorithms mentioned in the problem statement. 2. Ensure that all data structure insert and delete operations throw appropriate messages when their capacity is empty or full. Also ensure basic error handling is implemented. 3. For the purposes of testing, you may implement some functions to print the data structures or other test data. But all such functions must be commented before submission. 4. Make sure that your read, understand, and follow all the instructions 5. Ensure that the input, prompt and output file guidelines are adhered to. Deviations from the mentioned formats will not be entertained. 6. The input, prompt and output samples shown here are only a representation of the syntax to be used. Actual files used to evaluate the submissions will be different. Hence, do not hard code any values into the code. 7. Run time analysis is to be provided in asymptotic notations and not timestamp based runtimes in sec or milliseconds. 8. Please note that the design document must include: a. The data structure model you chose with justifications b. Details of each operations with the time complexity and reasons why the chosen operations are efficient for the given representation c. One alternate way of modeling the problem with the cost implications. 9. Writing a good technical report and well documented code is an art. Your report cannot exceed 4 pages. Your code must be modular and quite well documented. 10. You may ask queries in the dedicated discussion section. Beware that only hints will be provided and queries asked in other channels will not be responded to. Instructions for use of Python: 1. Implement the above problem statement using Python 3.7+. 2. Use only native data types like lists and tuples in Python, do not use dictionaries provided in Python. Use of external libraries like graph, numpy, pandas library etc. is not allowed. The purpose of the assignment is for you to learn how these data structures are constructed and how they work internally. 3. Create a single *.py file for code. Do not fragment your code into multiple files. 4. Do not submit a Jupyter Notebook (no *.ipynb). These submissions will not be evaluated. 5. Read the input file and create the output file in the root folder itself along with your .py file. Do not create separate folders for input and output files.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions