.

Wednesday, February 5, 2014

Algorithms

This ?le contains the exercises, hints, and solutions for Chapter 2 of the book Introduction to the Design and analytic thinking of Algorithms, 2nd edition, by A. Levitin. The problems that power be challenging for at least some students argon pronounced by ; those that exponent be di?cult for a majority of students atomic number 18 label by . Exercises 2.1 1. For each of the following algorithms, indicate (i) a infixed sizing metric for its inputs; (ii) its basic movement; (iii) whether the basic process count crowd out be di?erent for inputs of the same size: a. reckoning the sum of n rounds b. computing n! c. ?nding the largest protrude in a diagnose of n numbers d. Euclids algorithm e. sieve of Eratosthenes f. pen-and-pencil algorithm for multiplying two n-digit decimal integers 2. a. impart the de?nition-based algorithm for adding two n-by-n matrices. What is its basic operation? How many handbill is it performed as a function of the matrix order n? As a fu nction of the total number of elements in the input matrices? b. Answer the same questions for the de?nition-based algorithm for matrix multiplication. 3. surpass a variation of sequential search that scans a add up to return the number of occurrences of a given search spot out in the list. Will its e?ciency di?er from the e?ciency of unstained sequential search? 4. a. Glove endurance on that point are 22 gloves in a drawer: 5 pairs of rosy gloves, 4 pairs of yellow, and 2 pairs of green. You select the gloves in the blueish and can check them only by and by a selection has been made. What is the smallest number of gloves you need to select to have at least nonpareil matching pair in the best gaucherie? in the pommel case? (after [Mos01], #18) b. Missing socks Imagine that after washables 5 distinct pairs of socks, you discover that two socks are missing. Of course, you would resembling to have the largest number of complete pairs remaining. Thus, you are left with 4 complete pairs in the best-case scenario an! d with 3 complete pairs in the whip case. Assuming that the probability of...If you want to get a truthful essay, order it on our website: OrderCustomPaper.com

If you want to get a full essay, visit our page: write my paper

No comments:

Post a Comment