• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 56 páginas
Examen

Exam (elaborations) COMP 3530

Document preview thumbnail
Vista previa 4 fuera de 56 páginas

COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+ COMP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Already Graded A+

Vista previa del contenido

6/7/25, 1:07 AM COP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Alre…




Science Computer Science


COMP 3530 Exam 1 |2025 Update Comprehensive
Frequently Tested Questions And Verified Answers
|100% Accurate Answers | Already Graded A+




An algorithm's total run time O(n + p)
is given by the expression
T(n, p) = 10n + p. What is
the Big O Notation for this?
What is this big O O(1)
notation of this code
block?


for (int i = 100; i
> -1; i--) { for (int
j = 1; j > 1; j /=2)
{
//O(1) statemets
}
}
What is the big O notation O(n)
of this code block?


for (int i = n; i >
0; i /= 2) { for
(int j = 1; j < i;
j++) { sum +=
1;
}
}


… 1/56

,6/7/25, 1:07 AM COP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Alre…

Which one takes more time In terms of Big O, they are the same. Both O(log(n)). In
in terms of Big O? Which terms of execution, A will take more time.
will take more time in terms
of execution
time/simulation


//A
for (int i = 1; i < n; i *= 2) {
//O(1) functions
}

//B
for (int i = 1; i < n; i*= 3) {
//O(1) functions
}
Is the following statement FALSE!
accurate? "The best case
time complexity for Bubble
Sort is O(1) if the input
array only has one element"
What is the big O notation O(n)
of this code block:


// c is a positive
integer constant for (int
i = 1; i <=n, i+=c) {
//some O(1) expressions
}
for (int i = n; i > 0; i-=c) {
//some O(1) expressions
}




… 2/56

,6/7/25, 1:07 AM COP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Alre…


What is the big O notation O(log(n))
of this code block:


// c is a positive
integer constant for (int
i = 1; i <= n; i*= c) {
// some O(1) expressions
}
for (int i = n; i > 0; i /= c) {
//some O(1) expressions
}
What is the Big O of this code: O(ab), if a is the length of arrA and b is length of arrB. 100000
units of work is still O(1)
void printUnorder(int[]
arrA, int[] arrB) { for(int i
= 0; i < arrA.length; i++) {
for(int j = 0; j <
arrB.length; j++) {
for(int k = 0; k <
10000000; k++) { cout
<< hi;
}
}
}
What is the Big O of the O(n^2)
following code:

for (int i = n; i
> 0; i--) { for
(int j = 0; j < i;
j++) {
//Some O(1) expressions
}
}




… 3/56

, 6/7/25, 1:07 AM COP 3530 Exam 1 |2025 Update Comprehensive Frequently Tested Questions And Verified Answers |100% Accurate Answers | Alre…


What is the Big O of the O(n)
following code:

for (int i = n; i >
0; i /=2) { for(int
j = 0; j < i; j++)
{
//some O(1) expressions
}
}
What is the Big O of the O(1)
following code:

for (int i = 0; i < 1000000000;
i++) {
//some O(1) functions
}
Which of the following B. log(x)
algorithms grows faster?
a. log(log(x))

b. log(x)

c. Grow at same rate

Which of the following c. Grow at same rate
algorithms grows faster?
a. log3(x) => log base 3

b. log2(x) => log base 2

c. Grow at same rate

Which of the following B (nlog(n)), D(log(n)), and E(5,000,000)
functions belongs to the
family O(n^2)?
a. n^3

b. nlog(n)

c. n!

d. log(n)

e. 5,000,000

O(n *m), where n is the number of strings and m is the
What is the time complexity of length in characters of the longest string.
an algorithm that is counting
the number of "a"s in an -Note: if the length of the string is limited to perhaps 10




… 4/56

Información del documento

Subido en
7 de junio de 2025
Número de páginas
56
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$25.69

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
PETERWANJOHI
3.9
(16)
Vendido
112
Seguidores
4
Artículos
6332
Última venta
22 horas hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes