Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 6 páginas
Examen

CS 160 MIDTERM 2 EXAM |COMPLETE QUESTIONS WITH 100% RATED EXPERT SOLUTIONS |2026 LATEST UPDATED

Document preview thumbnail
Vista previa 2 fuera de 6 páginas

CS 160 MIDTERM 2 EXAM |COMPLETE QUESTIONS WITH 100% RATED EXPERT SOLUTIONS |2026 LATEST UPDATED

Vista previa del contenido

CS 160 MIDTERM 2 EXAM |COMPLETE QUESTIONS WITH 100% RATED EXPERT

SOLUTIONS |2026 LATEST UPDATED



1. The worst-case runtime of an algorithm is _____ number of steps taken to execute a program.: maximum

2. What is the merge sort algorithm's runtime?: O(N·logN)

3. The best case runtime complexity of an algorithm that searches an array of size N is _____.: O(1)

4. he following algorithm is an example of _____. (Hint: at each level we have two recursive calls. Each recursive

call makes two additional recursive calls. Hence, the number of recursive method calls doubles at each level).


def MyMath(num) if num

<= 1 return num

return MyMath(num - 2) + MyMath(num - 1): an exponential runtime complexity

5. The Big O notation of the algorithm 7+12N+3N2 is _____.: N2

6. Given a doubly-linked list (2, 3, 4, 5, 6, 7), node 2's pointer(s) point(s) to _____.: node 3 and null

7. Replace XXX in the following function header for a doubly-linked list: ListInsertAfter(listName, currentNode,

XXX): newNode

8. A recursive algorithm is based on _____ application(s) of the same algorithm on smaller problems.: repeated

9. comparable object: capable of comparing itself with another object

10. comparator: external to the element type we are comparing and is a separate class

11. arrayList class: a resizable array which can be found in the java.util package

12. built-in array: size of array can(not) be modified: cannot

13. arrayList class: size of array can(not) be modified: can

1/6

, 14. syntax to create an ArrayList object: ArrayList<String> cars = new ArrayList<String>();

15. linkedList is ______________ to arrayList: identical

16. a stack: LIFO

17. LIFO: objects can be inserted at any time, but only the last (the most-recently inserted) object can be removed

18. pushing is synonymous with: inserting

19. popping is synonymous with: removing 20. queue: FIFO

21 FIFO: elements may be inserted at any time, but only the element which has been in the queue the longest may be

removed

22. where are elements inserted and removed in queue: inserted at the rear (enqueued)

and removed from the front (dequeued)

23. the java deque interface represents: a double ended queue 24. push(stack, x): inserts x on top of

stack.

25. Pop(stack): returns and removes item at top of stack

26. Peek(stack): returns but does not remove item at top of stack

27. Enqueue(queue, x): inserts x at the end of the queue

28. Dequeue(queue): returns and removes item at front of queue

29. Peek(queue): returns but does not remove item at the front of the queue

30. PushFront(deque, x): inserts x at the front of the deque

31. PushBack(deque, x): inserts x at the back of the deque

32. PopFront(deque): returns and removes item at front of deque

33. PopBack(deque): returns and removes item at back of deque

2/6

Información del documento

Subido en
18 de julio de 2026
Número de páginas
6
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$22.99

¿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.
Henlens
5.0
(501)
Vendido
2187
Seguidores
1
Artículos
507
Última venta
3 horas hace

Reseñas de compradores verificados



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