• Mauvais document ? Échangez-le gratuitement
  • Rédigé par des étudiants ayant réussi
  • Disponible immédiatement après paiement
  • Lire en ligne ou en PDF
Vendre
Où étudie-tu ?
La langue
Document preview thumbnail
Aperçu 4 sur 34 pages
Examen

Cs 6515 Exam 2 Actual Test Paper Questions Correct Answers Graded A Plus.pdf

Document preview thumbnail
Aperçu 4 sur 34 pages

CS 6515 EXAM 2 ACTUAL TEST PAPER QUESTIONS CORRECT ANSWERS GRADED A PLUS.pdf

Aperçu du contenu

CS 6515 EXAM 2 ACTUAL TEST PAPER QUESTIONS CORRECT ANSWERS GRADED A PLUS




Question:
master theorem.

Answer:
-if f(n) = O n^(logba -∈) for some const ∈>0 then T(n) =θn^(logb a) if f(n) =θn^(log b a ) then
T(n)=θn^(logba) logn if f(n) =Ω(n^logba + ε) for some constant ε>0 and if af(n/b) ≥ cf(n) for some
constant c<1 and all sufficiently large n, then T(n) = θf(n) f(n) dominates g(n) iff grows
polynomially faster than g(n). this is a stronger condition than f(n) = ωg(n) does not apply for the
gap between the tree cases (little o and little omega)



Question:
when master theorem does not apply.

Answer:
a must be >= 1, b must be >1 (they don't necessarily need to be integers) can check this by the limit
test and leaving the + ∈ and if there is not an ∈ you can pick to make it polynomially faster, then the
rule does not apply f(n) is negative ex. nlogn / n^1+e cuz both have n^1 in it if a = 2^n (cuz not
constant) if constant work is subtracted



Question:
polynomially larger? n^2 vs. n.

Answer:
yes



Question:
polynomially larger? n^2logn vs. n^2.

,Answer:
no



Question:
polynomially larger? n^3 log n vs. n^2.

Answer:
yes



Question:
polynomially larger? n^2.001 vs. n^2.

Answer:
yes



Question:
polynomially larger? nlogn vs. n^log4 3.

Answer:
yes



Question:
applying the master theorem given recurrences.

Answer:
coefficient is a, division is b and function is constant work compare n^logb a vs. f(n)



Question:
special rules for master theorem.

Answer:

,-case 2 only: this happens when log_b a is equal to the degree of n in f(n). if there is no log then
master method does not apply. if there is a log, look at the power. if the power of the log is > -1, then
T(n) = theta log _ b a * log^k+1 n where k is the power of the log if the power of the log = -1 then
T(n) = theta log_ b a log log n if the power of the log < -1 then T(n) = theta log_ b a



Question:
proof by induction on the binary search.

Answer:
base case: on the 0 iteration, x exists in A or x never existed in A at all inductive hypothesis: x exists
in A iff x lies in the subarray A[L.H] inductive step: if(A[mid] <= x) L<- mid else H<- mid-1 if
A[L] = x return L



Question:
heap sort.

Answer:
insert n inputs into the heap. call extractmin n times. values sorted least to greatest



Question:
merge sort.

Answer:
based on linear merge of 2 sorted arrays. divide and conquer algorithm



Question:
selection sort.

Answer:
goes thru and finds the smallest element and brings it to the front of the array



Question:

, running time of bubble sort.

Answer:
n^2



Question:
insertion sort running time.

Answer:
n^2



Question:
shell sort running time.

Answer:
n^2 or n^4/3 or n log^2n



Question:
quick sort running time.

Answer:
n log n



Question:
model of computation.

Answer:
what we can do in constant time. sorting algorithm can only do limited work in constant time. they
can make limited decisions about their inputs in constant time



Question:
limited decisions for sorting.

Infos sur le Document

Publié le
12 août 2026
Nombre de pages
34
Écrit en
2026/2027
Type
Examen
Contient
Questions et réponses
$17.99

Mauvais document ? Échangez-le gratuitement Dans les 14 jours suivant votre achat et avant le téléchargement, vous pouvez choisir un autre document. Vous pouvez simplement dépenser le montant à nouveau.
Rédigé par des étudiants ayant réussi
Disponible immédiatement après paiement
Lire en ligne ou en PDF

Vendu
2
Abonnés
0
Éléments
6341
Dernière vente
4 heures de cela



Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Vous travaillez sur vos références ?

Créez des citations précises en APA, MLA et Harvard avec notre générateur de sources gratuit.

Vous travaillez sur vos références ?

Foire aux questions