Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

ISBN: 0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

2. What kinds of communication help sustain long-distance romances?

Answered: 1 week ago

Question

5) Simplify each of the following expressions

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago

Question

What is job rotation ?

Answered: 1 week ago