• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 2 van de 6 pagina's
Tentamen (uitwerkingen)

Algorithms Exam Questions and Answers Fully Solved Graded A+

Document preview thumbnail
Voorbeeld 2 van de 6 pagina's

Algorithms Exam Questions and Answers Fully Solved Graded A+ Definition of an algorithm - Answersa sequence of unambiguous instructions for solving a problem (for obtaining a required output for any legitimate input in a finite amount of time) Requirements of an algorithm - Answers- Non-ambiguity (set of steps) - Carefully specified range of inputs - Output must be correct for anything in that range - It has to be completed in a finite amount of time Misc algorithm stuff - Answers- Same algorithm can be represented in several different ways - Several algorithms for solving the same problem may exist - May have dramatically different speeds GCD (Euclids Alg) - Answersinput: two integers m and n, = 0 and not both 0 while n != 0 { r = m mod n m = n n = r } return m Steps for algorithm design - Answers1) Understand the problem 2) Figure out what your computer is capable of (sequential vs parallel) 3) Choose exact or approximate 4) Pick a data structure 5) Consider algorithm design techniques (Prove correctness, analyze algorithm, code it) Important problem types - Answers1) Sorting 2) Searching 3) String processing 4) Graph problems 5) Combinatorial 6) Geometric 7) Numeric Time Efficiency (Def) - AnswersHow fast an algorithm runs (easier to improve than space efficiency) Space Efficiency (Def) - AnswersHow much space an algorithm requires Basic Operation (Def) - AnswersThe most expensive most commonly used operation Order of Growth (order) - Answersc, log n, log (n^2), (log n) ^2, n^(1/3), n^(1/2), n, n (log n), n^2, n^3, 2^n, n! Is average case efficiency often (worst case + best case)/2? - AnswersNo Big Oh, O(g(n)) -meaning - AnswersSet of all functions with the same or smaller growth rates as g(n) Big Omega, Ω(g(n)) -meaning - AnswersSet of all functions with the same or greater growth rates than g(n) Big Theta, Θ(g(n)) -meaning - AnswersSet of all functions with the same order of growth as g(n) How do you prove big theta? - AnswersProve that big omega and big oh are of equal growth orders Big Oh, O(g(n)) -definition - Answersthere exists a positive constant (c) and a non-negative integer n0 such that

Voorbeeld van de inhoud

Algorithms Exam Questions and Answers Fully Solved Graded A+

Definition of an algorithm - Answersa sequence of unambiguous instructions for solving a problem (for
obtaining a required output for any legitimate input in a finite amount of time)

Requirements of an algorithm - Answers- Non-ambiguity (set of steps)

- Carefully specified range of inputs

- Output must be correct for anything in that range

- It has to be completed in a finite amount of time

Misc algorithm stuff - Answers- Same algorithm can be represented in several different ways

- Several algorithms for solving the same problem may exist

- May have dramatically different speeds

GCD (Euclids Alg) - Answersinput: two integers m and n, >= 0 and not both 0



while n != 0 {

r = m mod n

m=n

n=r

}

return m

Steps for algorithm design - Answers1) Understand the problem

2) Figure out what your computer is capable of (sequential vs parallel)

3) Choose exact or approximate

4) Pick a data structure

5) Consider algorithm design techniques

(Prove correctness, analyze algorithm, code it)

Important problem types - Answers1) Sorting

2) Searching

, 3) String processing

4) Graph problems

5) Combinatorial

6) Geometric

7) Numeric

Time Efficiency (Def) - AnswersHow fast an algorithm runs (easier to improve than space efficiency)

Space Efficiency (Def) - AnswersHow much space an algorithm requires

Basic Operation (Def) - AnswersThe most expensive most commonly used operation

Order of Growth (order) - Answersc, log n, log (n^2), (log n) ^2, n^(1/3), n^(1/2), n, n (log n), n^2, n^3,
2^n, n!

Is average case efficiency often (worst case + best case)/2? - AnswersNo

Big Oh, O(g(n)) -meaning - AnswersSet of all functions with the same or smaller growth rates as g(n)

Big Omega, Ω(g(n)) -meaning - AnswersSet of all functions with the same or greater growth rates than
g(n)

Big Theta, Θ(g(n)) -meaning - AnswersSet of all functions with the same order of growth as g(n)

How do you prove big theta? - AnswersProve that big omega and big oh are of equal growth orders

Big Oh, O(g(n)) -definition - Answersthere exists a positive constant (c) and a non-negative integer n0
such that



t(n) <= c*g(n) for all n>= n0

Big Omega, Ω(g(n)) -definition - Answersthere exists a positive constant (c) and a non-negative integer
n0 such that



t(n) >= c*g(n) for all n>= n0

Big Theta, Θ(g(n)) -definition - Answersthere exists a positive constants (c1 and c2) and a non-negative
integer n0 such that

Documentinformatie

Geüpload op
3 augustus 2025
Aantal pagina's
6
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
$10.99

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kan je een ander document kiezen. Je kan het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
TutorJosh
3.5
(77)
Verkocht
508
Volgers
16
Items
33081
Laatst verkocht
3 dagen geleden




Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen