What is the running time complexity of your radixSort method?

Published by Jeannie R. Ferrell

Nov 17, 2022

s

Struggling with a similar assignment? Don’t know where to start? Don’t have time to work on this? Get a high-quality paper written for you from scratch – PLAGIARISM FREE, guaranteed to get you a good grade. To get started, please click on the Submit Your Instructions at the bottom of the page.

Purpose:
This assignment has 3 problems. The problems 1 and 2 are related to some of the
important topics we studied in the Module 6. The problem 3 is related to some of the
important topics of Module 7.
The purpose of this assignment is:
• Value the use of the different sub-quadratic sorting algorithms and consider the
possibility to sort in linear time for some particular problems.
• To apply efficient algorithms for some fundamental problems on graphs.
• To apply basic techniques of algorithm analysis to implement efficient algorithms.

Submitting Your Assignment:
• Assignments must be turned in via Canvas.
• Please follow these steps for every assignment:
1. You are allowed to upload only a single ZIP file and no other kinds of
compressed files will be accepted!
2. Please name your submission as 3_XXXXXXX.ZIP, where XXXXXXX is your
seven-digit Panther ID number.
3. Inside ZIP folder, there should be a separate folder for each question (i.e.
Problem 1, Problem 2, Problem 3, etc)
4. For questions that require Java implementation:
• The .java file must be inside the corresponding problem folder. DO NOT MIX
ANSWERS.
• ONLY SUBMIT .JAVA FILES. DO NOT SUBMIT YOUR WHOLE PROJETC’S
FOLDER!!!
• If is required, each .java file should contain ITS OWN main method at the
bottom of the file. One main method for EACH .java file.
5. For written questions:
• Submit these files INSIDE the specific problem folder.
• Each answer MUST be identified. It should be easy to tell which question and
subsection you are answering!
• Written questions must be only in PDF format.
6. Please include the following header for each Java program:
/**************************************************************
Purpose/Description:
Author’s Panther ID:
Certification:
I hereby certify that this work is my own and none of it is the work of
any other person.
**************************************************************/
7. Submissions turned in after the due date and/or which don’t meet the
established formatting rules will not be accepted.
 Failure to follow these simple directions may result in a loss of credit for the
assignment.
Problem #1: (30 pts)
(a) Implement (in Java) the radixSort algorithm to sort in increasing order an array of
integer positive keys.
public void radixSort(int arr[])
In your implementation you must consider that each key contains only even digits (0, 2, 4,
6, and 8). Your program must detect the case of odd digits in the keys, and, in this case,
abort.
Example #1:
Input: 24, 12, 4, 366, 45, 66, 8, 14
Output: *** Abort *** the input has at least one key with odd digits
Example #2:
Input: 24, 2, 4, 466, 48, 66, 8, 44
Output: 2, 4, 8, 24, 44, 48, 66, 466
(b) What is the running time complexity of your radixSort method? Justify.
Important Notes:
• To storage and process the bucket lists, use an ArrayList structure.
• You must add the main method in your program in Java in order to test your
implementation.
• You can use the array of the previous example to test your program, however, I
suggest that you also use other input arrays to validate the correctness and
efficiency of your solution.
• Your program MUST be submitted only in source code form (.java file).
• A program that does not compile or does not run loses all correctness points.

Problem #2: (35 pts)
(a) Given the following list of numbers:
3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5
trace the execution for quicksort with median-of-three partitioning and a cutoff of 3.
(b) The processing time of an algorithm is described by the following recurrence equation (c
is a positive constant):
T(n) = 3T(n/3) + 2cn; T(1) = 0
What is the running time complexity of this algorithm? Justify.
(c) You decided to improve insertion sort by using binary search to find the position p where
the new insertion should take place.
(c.1) What is the worst-case complexity of your improved insertion sort if you take account
of only the comparisons made by the binary search? Justify.
(c.2) What is the worst-case complexity of your improved insertion sort if only
swaps/inversions of the data values are taken into account?

Problem #3: (35 pts)
(a) Either draw a graph with the following specified properties, or explain why no such
graph exists:

A simple graph with five vertices with degrees 2, 3, 3, 3, and 5.

(b) Consider the following graph. If there is ever a decision between multiple neighbor
nodes in the BFS or DFS algorithms, assume we always choose the letter closest to the
beginning of the alphabet first.

(b.1) In what order will the nodes be visited using a Breadth First Search starting from
vertex A and using a queue ADT?
(b.2) In what order will the nodes be visited using a Depth First Search starting from
vertex A and using a stack ADT?
(c) Show the ordering of vertices produced by the topological sort algorithm given in class
starting from vertex V1 when it is run on the following direct acyclic graph (represented by
its adjacency list, in-degree form). Justify.

V0 —
V1 —
V2 V0, V1
V3 V0, V1
V4 V0, V2
V5 V1
V6 V2, V4, V5
V7 V6

n

Need Writing Help? Our writing specialists are here 24/7, every day of the year, ready to support you! Instantly chat with an online tutor below or click here to submit your paper instructions to the writing team.

More than just an assignment.

GET THE GRADES YOU DESERVE | A OR A- GUARANTEED
NO MORE SLEEPLESS NIGHTS DOING RESEARCH
NO MORE LATE POINTS DEDUCTIONS 
GET A QUALITY PAPER SENT TO YOUR EMAIL
GET GOOD GRADES ON YOUR ASSIGNMENTS
Explore Now →

Who is this homework service for?

* If you are having a really hard class and want to get through it, then this is for you.

* If you have a medical emergency or someone close to you has a medical emergency and you don’t think you’ll be able to turn your assignment on time, this is definitely a service you could use.

* You can use us if you are having a tough Professor who won’t give you the grades you deserve.

* If you have a tight work schedule and you are getting points deducted for not submitting assignments on time.

* English might not be your first language and you feel like you are being left behind in class because of it.

* If you have a large project coming up and don’t think you have enough time to get it done well, definitely reach out to us.

TALK TO SUPPORT
{

Super stoked you are checking us out! We would like to help you with your assignment. We just need a few things from you:

* The full assignment instructions as they appear on your school account.

* If a Rubric is present, make sure to attach it.

* Any relevant weekly readings or learning resources.

* Include any special announcements or emails you might have gotten from your Professor regarding your assignment.

* Any templates or additional files required to complete the assignment.

If your assignment is somewhat complex and you need to explain it, please don’t hesitate to reach out to me via live chat. 

 

FAQ

Frequently asked questions

How soon can I get my paper done?

It depends with your deadline. If you need your paper completed in 3 hours, we will deliver it in that time. All you need to do is indicate your deadline in our custom order page here. Alternatively, if you are sending us your instructions via email, please be sure to indicate your deadline.

Will it be completely original? I don't want to be caught in a case of Academic Integrity Violation.

We are as paranoid as you are. Maybe even more! And we understand that the greatest sin you can commit in your academic journey is plagiarizing your academic work. To that end, we have made sure that we check and double-check our papers using high quality plagiarism detection tools such as SafeAssign and Turnitin before submitting the paper to you.

Who is my writer? Is he/she a native English Speaker?

All our writers are native English Speakers. That is not to say that ESL writers are not good, we just prefer hiring native writers because we want the very best people working on your paper. This might mean paying a little bit more for your paper as opposed to when you pay a foreign company whose writers are non-native English Speakers.

What if I need revisions? Will your charge additional for this?

Of course not! If you do happen to require a revision on your paper, our team will handle it for you free of charge. Matter of fact, we won’t rest till you are happy with your paper. So, ask for as many revisions as you need, it’s completely FREE!

Will you give me my money back if I don't like my paper?

We have very few instances where we delivered a paper that a client didn’t fall in love with. But if it so happens that you don’t like your paper for any reason whatsoever, we’ll refund your money back no questions asked.

I have more assignments after this, can you help me with those too?

Of course! And what’s even better is that we can reserve a writer permanently to work on your entire class. This comes in handy for projects which build up on each other and where you need just one writer, one writing style.

I got my order information wrong, can I change that?

Yes you can. Just reach out to our support team via email (support@essaynook.com) or live chat here and they’ll help you change the instructions.

Can I place an order via email instead of going through the order page?

Yes you can. Email Anna at anna@essaynook.com, she’s in charge of our sales team. Alternatively, you can talk to our Live Chat team here and request to speak to Anna.

Trusted by Thousands of Students

Delivering quality assignments since 2007