• ¿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 1 fuera de 2 páginas
Examen

Data Structures and Algorithms Qs & As

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

Data Structures and Algorithms A linked-list implementation of a stack guarantees constant time performance but requires more space than an array implementation. - Answer- TRUE Both implementations of pop and push guarantee constant time performance. Linked lists require additional memory (space) for storing a reference to the next node. An algorithm that uses 12n2 + 4n log n operations is a ∼n2 algorithm. - Answer- FALSE It is a ∼ 12n2 algorithm. Big-Oh notation is more precise than tilde notation at describing the growth of a function. - Answer- FALSE Big-Oh notation only provides an upper bound on the growth rate of a function. Tilde approximation approaches the original function as N grows. When implementing the Comparable interface, you should make sure that your implementation of the compareTo() method specifies a total order over the objects. - Answer- TRUE When implementing the Comparable interface, you should make sure that your implementation of the compareTo() method specifies a total order over the objects. Mergesort - Answer- Stable and fast Quicksort - Answer- Fast general-purpose sort Shellsort - Answer- Not analyzed Insertion sort - Answer- Works well with order Selection sort - Answer- Optimal data movement 3-way quicksort - Answer- Works well with duplicates Heapsort - Answer- Optimal time and space Height of a binary heap with N keys. - Answer- log N A binary heap is a complete tree. A complete tree is a tree with n levels, where for each level d ≤ n − 1, the number of existing nodes at level d is equal to 2d. The height of a binary heap is logN. Height of a BST with N keys. - Answer- N In the worst-case, the height of a BST is N, e.g., when keys are inserted in increasing or de- creasing order. Number of comparisons to sort N equal keys using our standard version of quicksort.

Vista previa del contenido

Data Structures and Algorithms
A linked-list implementation of a stack guarantees constant time performance but
requires more space than an array implementation. - Answer- TRUE
Both implementations of pop and push guarantee constant time performance. Linked
lists require additional memory (space) for storing a reference to the next node.

An algorithm that uses 12n2 + 4n log n operations is a ∼n2 algorithm. - Answer-
FALSE
It is a ∼ 12n2 algorithm.

Big-Oh notation is more precise than tilde notation at describing the growth of a
function. - Answer- FALSE
Big-Oh notation only provides an upper bound on the growth rate of a function. Tilde
approximation approaches the original function as N grows.

When implementing the Comparable interface, you should make sure that your
implementation of the compareTo() method specifies a total order over the objects. -
Answer- TRUE
When implementing the Comparable interface, you should make sure that your
implementation of the compareTo() method specifies a total order over the objects.

Mergesort - Answer- Stable and fast

Quicksort - Answer- Fast general-purpose sort

Shellsort - Answer- Not analyzed

Insertion sort - Answer- Works well with order

Selection sort - Answer- Optimal data movement

3-way quicksort - Answer- Works well with duplicates

Heapsort - Answer- Optimal time and space

Height of a binary heap with N keys. - Answer- log N

A binary heap is a complete tree. A complete tree is a tree with n levels, where for
each level d ≤ n − 1, the number of existing nodes at level d is equal to 2d. The
height of a binary heap is logN.

Height of a BST with N keys. - Answer- N

In the worst-case, the height of a BST is N, e.g., when keys are inserted in
increasing or de- creasing order.

Información del documento

Subido en
18 de agosto de 2024
Número de páginas
2
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$8.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.
Freshy
3.6
(11)
Vendido
64
Seguidores
4
Artículos
6965
Última venta
2 semanas 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