Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CMSC 351 Homework 3: Algorithm Analysis - Prof. Clyde P. Kruskal, Assignments of Algorithms and Programming

The third homework assignment for the computer science course cmsc 351, taught by clyde kruskal during the summer 2009 semester. The assignment includes three problems related to algorithm analysis, focusing on the comparison of different multiplication algorithms and the recursive implementation of selection sort.

Typology: Assignments

Pre 2010

Uploaded on 07/30/2009

koofers-user-wv9
koofers-user-wv9 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download CMSC 351 Homework 3: Algorithm Analysis - Prof. Clyde P. Kruskal and more Assignments Algorithms and Programming in PDF only on Docsity! Summer 2009 CMSC 351: Homework 3 Clyde Kruskal Due at the start of class Friday, June 12, 2009. Problem 1. Assume your machine has 32 bit words. Assume you can multiply two n word numbers in time 3n2 with a standard algorithm. Assume you can multiply two n word numbers in time 20nlg 3 with a “fancy” algorithm. (a) Approximately, how large does n have to be for the fancy algorithm to be better? (b) How many bits is that? (c) How many decimal digits is that? Problem 2. Use the same assumptions as for problem (1), except assume you can multiply two n word numbers in time only 10nlg 3 with a “fancy” algorithm. (a) Approximately, how large does n have to be for the fancy algorithm to be better? (b) How many bits is that? (c) How many decimal digits is that? Problem 3. Selection Sort can be thought of as a recursive algorithm as follows: Find the largest element and put it at the end of the list (to be sorted). Recursively sort the remaining elements. (a) Write down the recursive version of Selection Sort in psuedocode. (b) Derive a recurrence for the exact number of comparisons the algorithm uses. (c) Use the iteration method to solve the recurrence. Simplify as much as possible. (d) Use mathematical induction to verify your solution.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved