Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python You are placed in charge of the email servers as part of your unpaid internship at Holistic Synergies, Ltd. Your supervisor, Dr. Boss Manager
Python
You are placed in charge of the email servers as part of your unpaid internship at Holistic Synergies, Ltd. Your supervisor, Dr. Boss Manager IL has compromised company security by leaking data to hackers over email on mutiple occasions. However, he has a solution. After watching a certain soi movie series, Dr. Manager has come to the conclusion that hackers always use short, trendy names like Neo" or "Cypher. Therefore, rather than displaying emails n order from newest to oldest, he orders you to reprogram the server to display emails from longest sender name to shortest, so that all of the emails from people with short hacker namers are pushed to the bottom Speed is of the utmost importance to Holistic Synergies, Ltd, so you wil be implementing this email sorting routine in Quicksort. However, Dr. Manager beleves that his ancient enemy, Ted from Accounting, will take advantage of Quicksorf's O(n) worst-case runtime to slow down his email by sending many consecutive emails from aliases of ever-increasing length So, he also requires that a backup implementation be created using Merge Sort Download the template PA2 py from the class website. The template includes a Enail class which consists of two instance variables: sender, which is a string representing the name of the person or entity who sent the email, and subject, which is a string representing the subject ine of the email. The file also includes some test cases representing sample inboxes for Holistc Synergies, Ltd employees. You need to implement Merge Sort and Quicksort algonthm which operate on a list of Emal objects, and sort tem in non-ncreasrg orderby wytaf he sender string . You must download the template fle PA2 py and edit the merge, merge sort partition, and quick_sort functions. Do not edit any other part of the Se Your program must run without errors on the version of Python installed on the CSELabs machines, Python 3.52 (you'ne testing this on CSELabs, you need to type python3 or de3 instead of python or idle to start the correct version from the terminal) . You are not permitted to use any built-in Python sorting routines like the sorted) function or the sort) list method. You are also not allowed to use any Python function that asks for user input, such as input). as this will break the grading script You may not import any modules other than traceback, which is already imported by the template . You must implement the Quicksort and Merge Sort algorithms as described in the extbook. Any other sorting algorithms will receive very ltie credit even E you pass every test case However, note that whle the Sextbook algorithms describe how to sort a ist of numbers n non-decreasing order, this problem requires you to sort a list of Email objects in non-ncreasing order by length of sender name, so you wil need to adjust the algorhm The text ook version of Merge Sort is o stable algorthm; your Merge Sort must also be stable: the final Merge Sort est case checks this. Quicksort is not stable, so yours does not have to be. . This assignment will be graded automatically based on the number of test cases your program passes. There wil be several secret test cases in addition to the ones included n the template to ensure you're not hard-coding in the soluions . The grading breakdown for this assignment is as follows 30%: File runs without syntax errors 70%: Passing test cases without breaking any requirements.. o o The unedited termplate file already runs without syntax errors and passes 6/12 test cases (because 6 of the 12 test cases are lists that are already in sorted order). This means that if your program causes syntax errors or passes less than 6/12 test cases, you will get a beter score by just submitting the oniginal template unedited Submit your edted PA2 py fle to the Programming Assignment 2 link on Canvas before 10.30 AM on 9/18/18. No credt wil be given for late submissions 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