• ¿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 Final Exam Study Guide Qs & As

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

Data Structures and Algorithms Final Exam Study Guide Depth First Search - Answer- "think sink" Root node first Visit Root - visit left child - repeat until no more left children - visit sibling - if children visit those - climb back up Post-Order Traversal - Answer- Visit node after all children are visited Root node last Breadth First Search - Answer- Visit nodes top to Bottom, left to right like reading a book In-Order Traversal - Answer- Visit node after left child but before right Must be BST Complexity of traversing tree - Answer- Linear Complexity of inserting into a tree - Answer- Logarithmic to Linear Removing a Node from a BST - Answer- Replace node with smallest value from right subtree Splay Tree - Answer- a self-balancing binary tree that places recently accessed elements near the top of the tree for fast access. Zig Rotation - Answer- Parent is moved to become child of node (single rotation) zig-zag rotation - Answer- If the node is left child of the parent which is right child of grandparent, move grandchild up two levels and grandparent right child (double rotation) zig-zig rotation - Answer- If the node is the left child of the parent which is also the left child of the grandparent, move up grandchild two levels by making parent right child and grandparent right child of the parent (double rotation) Time Complexity - Answer- the amount of time taken by an algorithm to run as a function of the input size Auxiliary Complexity - Answer- The amount of memory used by algorithm Space Complexity - Answer- The total space taken by an algorithm with respect to the input size time complexity for stacks and queues - Answer- search: linear insert/push: constant remove/pop: constant

Vista previa del contenido

Data Structures and Algorithms Final
Exam Study Guide
Depth First Search - Answer- "think sink" Root node first
Visit Root -> visit left child -> repeat until no more left children -> visit sibling -> if
children visit those -> climb back up

Post-Order Traversal - Answer- Visit node after all children are visited
Root node last

Breadth First Search - Answer- Visit nodes top to Bottom, left to right like reading a
book

In-Order Traversal - Answer- Visit node after left child but before right
Must be BST

Complexity of traversing tree - Answer- Linear

Complexity of inserting into a tree - Answer- Logarithmic to Linear

Removing a Node from a BST - Answer- Replace node with smallest value from right
subtree

Splay Tree - Answer- a self-balancing binary tree that places recently accessed
elements near the top of the tree for fast access.

Zig Rotation - Answer- Parent is moved to become child of node (single rotation)

zig-zag rotation - Answer- If the node is left child of the parent which is right child of
grandparent, move grandchild up two levels and grandparent right child (double
rotation)

zig-zig rotation - Answer- If the node is the left child of the parent which is also the
left child of the grandparent, move up grandchild two levels by making parent right
child and grandparent right child of the parent (double rotation)

Time Complexity - Answer- the amount of time taken by an algorithm to run as a
function of the input size

Auxiliary Complexity - Answer- The amount of memory used by algorithm

Space Complexity - Answer- The total space taken by an algorithm with respect to
the input size

time complexity for stacks and queues - Answer- search: linear
insert/push: constant
remove/pop: constant

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.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
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