• ¿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 35 páginas
Examen

Software Engineering Algorithms and Data Structures - SEADS-203

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

Software Engineering Algorithms and Data Structures - SEADS-203

Vista previa del contenido

1. Which of the following is a stable sorting algorithm?

A. QuickSort

B. MergeSort

C. HeapSort

D. SelectionSort

Answer: b) MergeSort

Rationale: A stable sorting algorithm maintains the relative order of

records with equal keys (values). MergeSort is stable, while QuickSort,

HeapSort, and SelectionSort are not stable by default.



2. What is the time complexity of the binary search algorithm?

A. O(n)

B. O(log n)

C. O(n^2)

D. O(1)

,Answer: b) O(log n)

Rationale: Binary search works by dividing the search space in half at

each step, which results in a logarithmic time complexity, O(log n),

when the input is sorted.



3. Which of the following data structures can be used to implement a

breadth-first search (BFS)?

A. Stack

B. Queue

C. Array

D. Linked List

Answer: b) Queue

Rationale: BFS explores nodes level by level, which is naturally

implemented using a queue. Nodes are processed in the order they are

discovered, which is a FIFO (First In First Out) structure, like a queue.



4. What is the worst-case time complexity of QuickSort?

,A. O(n)

B. O(n log n)

C. O(n^2)

D. O(log n)

Answer: c) O(n^2)

Rationale: QuickSort's worst-case time complexity is O(n^2) when the

pivot chosen is the smallest or largest element in the array, leading to

unbalanced partitions. However, its average case is O(n log n).



5. What is the primary disadvantage of using a linked list over an

array?

A. Random access is not possible

B. Linked lists require less memory

C. Insertion and deletion are slower

D. Arrays are more flexible

Answer: a) Random access is not possible

, Rationale: In a linked list, accessing an element requires traversing the

list from the beginning, so random access (directly accessing an index)

is not possible like it is in arrays.



6. In which of the following cases would you use a hash table?

A. When you need fast access to elements by key

B. When you need to maintain elements in sorted order

C. When you need to perform frequent deletions and insertions

D. When you need to implement recursion

Answer: a) When you need fast access to elements by key

Rationale: Hash tables provide average constant time complexity (O(1))

for access, insertion, and deletion operations by using a key to directly

access an element, making it ideal for fast lookups.



7. Which of the following algorithms is used to find the shortest path in

a graph with non-negative weights?

A. Bellman-Ford

Información del documento

Subido en
13 de marzo de 2025
Número de páginas
35
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$10.49

¿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
douglasmugwe82
5.0
(1)
Vendido
2
Seguidores
0
Artículos
4215
Última venta
1 año 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