Summary Introduction to Algorithms 3rd Edition Solution Manual
24 keer bekeken 0 keer verkocht
Vak
ALGO101
Instelling
University Of San Andrés (UdeSA
)
Boek
Introduction to Algorithms, third edition
Introduction to Algorithm 3rd Edition Solution Manual by Cormen, Leiserson, Rivest, and Stein. It was typeset using the LaTeX language, with most diagrams done using Tikz.
Contains all of the answers of the exercises except for: 26-3(b,c), 28.2-3, 30.2-6, 30.3-2, 31.9-4.
Contains all of the answers of the exercises except for: 26-3(b,c), 28.2-3, 30.2-6, 30.3-2, 31.9-4.
7 februari 2024
530
2023/2024
Samenvatting
Onderwerpen
solutions manu
introduction to algorithms 3rd edition solutions
solutions introduction to algorithms 3rd edition
introduction to algorithms solutions manual
solutions manual introduction to algorithms
Gekoppeld boek
Titel boek:
Auteur(s):
Uitgave:
ISBN:
Druk:
Meer samenvattingen voor studieboek
Solutions Manual for A Practical Introduction to Data Structures and Algorithm Analysis Second Edition Clifford A. Shaffer
Summary Introduction to Algorithms, third edition, ISBN: 9780262258104 CSC-249 (CSC-249)
Data Structures and Algorithms Summary (2021-2022)
Alles voor dit studieboek
(5)
Geschreven voor
University of San Andrés (UdeSA

)
ALGO101
Alle documenten voor dit vak (1)
Verkoper
Volgen
SolutionsWizard
Ontvangen beoordelingen
Voorbeeld van de inhoud
Chapter 1
Michelle Bodnar, Andrew Lohr
August 28, 2017
Exercise 1.1-1
An example of a real world situation that would require sorting would be if
you wanted to keep track of a bunch of people’s file folders and be able to look
up a given name quickly. A convex hull might be needed if you needed to secure
a wildlife sanctuary with fencing and had to contain a bunch of specific nesting
locations.
Exercise 1.1-2
One might measure memory usage of an algorithm, or number of people
required to carry out a single task.
Exercise 1.1-3
An array. It has the limitation of requiring a lot of copying when re-sizing,
inserting, and removing elements.
Exercise 1.1-4
They are similar since both problems can be modeled by a graph with
weighted edges and involve minimizing distance, or weight, of a walk on the
graph. They are different because the shortest path problem considers only
two vertices, whereas the traveling salesman problem considers minimizing the
weight of a path that must include many vertices and end where it began.
Exercise 1.1-5
If you were for example keeping track of terror watch suspects, it would be
unacceptable to have it occasionally bringing up a wrong decision as to whether
a person is on the list or not. It would be fine to only have an approximate
solution to the shortest route on which to drive, an extra little bit of driving is
not that bad.
1
,Exercise 1.2-1
A program that would pick out which music a user would like to listen to
next. They would need to use a bunch of information from historical and pop-
ular preferences in order to maximize.
Exercise 1.2-2
We wish to determine for which values of n the inequality 8n2 < 64n log2 (n)
holds. This happens when n < 8 log2 (n), or when n ≤ 43. In other words,
insertion sort runs faster when we’re sorting at most 43 items. Otherwise merge
sort is faster.
Exercise 1.2-3
We want that 100n2 < 2n . note that if n = 14, this becomes 100(14)2 =
19600 > 21 4 = 16384. For n = 15 it is 100(15)2 = 22500 < 215 = 32768. So,
the answer is n = 15.
Algorithm 1 Non-increasing Insertion-Sort(A)
1: for j = 2 to A.length do
2: key = A[j]
3: // Insert A[j] into the sorted sequence A[1..j − 1].
4: i=j−1
5: while i > 0 and A[i] < key do
6: A[i + 1] = A[i]
7: i=i−1
8: end while
9: A[i + 1] = key
10: end for
Exercise 2.1-3
On each iteration of the loop body, the invariant upon entering is that there
is no index k < j so that A[k] = v. In order to proceed to the next iteration of
the loop, we need that for the current value of j, we do not have A[j] = v. If
the loop is exited by line 5, then we have just placed an acceptable value in i
on the previous line. If the loop is exited by exhausting all possible values of j,
then we know that there is no index that has value j, and so leaving N IL in i
is correct.
Exercise 2.1-4
1
, Algorithm 2 Linear-Search(A,v)
1: i = N IL
2: for j = 1 to A.length do
3: if A[j] = v then
4: i=j
5: return i
6: end if
7: end for
8: return i
Input: two n-element arrays A and B containing the binary digits of two
numbers a and b.
Output: an (n + 1)-element array C containing the binary digits of a + b.
Algorithm 3 Adding n-bit Binary Integers
1: carry = 0
2: for i=n to 1 do
3: C[i + 1] = (A[i] + B[i] + carry) (mod 2)
4: if A[i] + B[i] + carry ≥ 2 then
5: carry = 1
6: else
7: carry = 0
8: end if
9: end for
10: C[1] = carry
Exercise 2.2-1
n3 /1000 − 100n2 − 100n + 3 ∈ Θ(n3 )
Exercise 2.2-2
Input: An n-element array A.
Output: The array A with its elements rearranged into increasing order.
The loop invariant of selection sort is as follows: At each iteration of the for
loop of lines 1 through 10, the subarray A[1..i − 1] contains the i − 1 smallest
elements of A in increasing order. After n − 1 iterations of the loop, the n − 1
smallest elements of A are in the first n − 1 positions of A in increasing order,
so the nth element is necessarily the largest element. Therefore we do not need
to run the loop a final time. The best-case and worst-case running times of
selection sort are Θ(n2 ). This is because regardless of how the elements are
initially arranged, on the ith iteration of the main for loop the algorithm always
inspects each of the remaining n − i elements to find the smallest one remaining.
2
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper SolutionsWizard. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor €9,80. Je zit daarna nergens aan vast.