Submit to Blackboard before the deadline. You will be able to revise your answers until the deadline with no penalty.
IMPORTANT: By submitting your answers, you are certifying that these answers have been exclusively your own work. All students enrolled in this course are expected to adhere to the UT Arlington Honor Code:
I pledge, on my honor, to uphold UT Arlington's tradition of academic integrity, a tradition that values hard work and honest effort in the pursuit of academic excellence. I promise that I will submit only work that I personally create or contribute to group collaborations, and I will appropriately reference any work from other sources. I will follow the highest standards of integrity and uphold the spirit of the Honor Code.
void quicksort_random(int * a, int left, int right)Submit your function in a program called task1.c.
Show, how quicksort (textbook program 7.1) sorts an array containing these characters: E A S Y Q U E S T I O N.
Suppose that an ordered file of size N is to be combined with an unordered file of size M, with M much smaller than N. Assume that you have a sorting program that takes about c1N lg N seconds to sort a file of size N and a merging program that takes about c1(N + M) seconds to merge a file of size N with one of size M. How many times faster than resorting is the suggested merge-based method, as a function of M, for N = 103, 106, and 109?
How does the strategy of using insertion sort for the whole file compare with the two methods postulated in the previous task? Assume that the small file is random, so each insertion goes about halfway into the large file, and the running time is about c1MN/2.
Explain how to use a priority queue ADT to implement a stack ADT.
Explain how to use a priority queue ADT to implement a queue ADT.
Criticize the following idea: To implement find the maximum in constant time, why not keep track of the maximum value inserted so far, then return that value for the find_the_maximum operation?
Is an array that is sorted in descending order a heap?
The largest element in a heap must appear in position 1, and the second largest element must be in position 2 or position 3. Give the list of positions in a heap of size 15 where the kth largest element (i) can appear, and (ii) cannot appear, for k = 2, 3, 4 (assuming the values to be distinct).
The assignment should be submitted via Blackboard. Submit a ZIPPED directory called Firstname_Lastname.zip. No other forms of compression are accepted, contact the instructor or TA if you do not know how to produce .zip files. The zipped directory should contain the following documents:
IMPORTANT: Pay close attention to all specifications on this page, including file names and submission format. Even in cases where your answers are correct, points will be taken off liberally for non-compliance with the instructions given on this page (such as wrong file names, wrong compression format for the submitted code, and so on). The reason is that non-compliance with the instructions makes the grading process significantly (and unnecessarily) more time consuming. Contact the instructor or TA if you have any questions.
Back to the list of assignments.