ITEC 2620 Lecture Notes - Quicksort, Binary Search Algorithm, Linked List

574 views5 pages

Document Summary

Question 1 (15 marks) short answer (maximum 20 words): Part b (3 marks): the first time you run algorithm a on a dataset of n elements; it is faster than algorithm b. The second time you run algorithm a on a dataset of n elements; it is slower than algorithm b. Give an example for algorithm a and algorithm b. Part e (3 marks): an implementation of quicksort has its worst case of o(n2) for an array in sorted order. Explain how this is possible/how this version of quicksort was implemented. Assume that an array has n random values. What is the time complexity of the following method that makes every element in the array equal to the largest element in the original array. Write a recursive function that will calculate the height of a binary tree. Note: root1 and root2 are instances of the class binnode: root2.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents