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
Examen

CMPT 280 MIDTERM EXAM QUESTIONS AND CORRECT ANSWERS

Puntuación
-
Vendido
-
Páginas
5
Grado
A+
Subido en
21-12-2024
Escrito en
2024/2025

CMPT 280 MIDTERM EXAM QUESTIONS AND CORRECT ANSWERS...

Institución
CMPT 280
Grado
CMPT 280

Vista previa del contenido

CMPT 280 MIDTERM EXAM QUESTIONS AND CORRECT ANSWERS



What is a heap? - Answer a binary tree which has the heap property



Name a heap property - Answer * Parent nodes have to be >= children nodes

*largest item (root) removed in delete



Define the term 'parent' in regards to a tree - Answer a direct ancestor of current node.
[directly above current node]



Define the term 'ancestor' in regards to a tree - Answer a node that comes before the
node we are currently on [path to root]



Define the term 'descendant' in regards to a tree - Answer a node that comes after the
node we are currently on [path away from root]



Identify the information that must be stored in a binary tree node - Answer *an element
of type <I>

*reference to root node of left and right subtree children



Define characteristics of a binary tree root node - Answer *it has no parent

*it can have 0-2 children



Informally describe an implementation of a binary tree within the framework of lib280 -
Answer *implement container interface [ because it collects elements]

*define methods [rootItem(), rootRightSubtree(LeftSubtree), ..etc

*create class that stores information about nodes

, describe the conditions under which nodes must be visited in a depth-first tree traversal
- Answer start at root; visit children [subtree] of visited node before visiting nodes
sibling(s) [other subtree]



identify valid depth-first traversals of trees - Answer *post-order * from left to right

*pre-order *from right to left

*in-order *in random order



describe the conditions under which nodes must be visited in a breadth-first tree
traversal - Answer start at root; visit all nodes in current level before going to next level



identify valid breadth-first traversals of trees - Answer *level order traversal [visited
from left to right]



define and identify pre-order - Answer start at root; node, left, right

*nodes visited before subtrees



define and identify post-order traversals of binary trees. - Answer start at left most
bottom; left, right, node



define and identify in-order traversals of binary trees. - Answer start at left most bottom;
left, node, right

*not a breadth-first traversal



define what an ordered binary tree is - Answer [a.k.a binary search tree] an additional
structure which arranges elements in a tree making it more efficient during searches



What properties must a ordered binary tree possess? - Answer *elements stored to the
left of a node is LESS than said node

*elements stored to the right of a node is GREATER than or equal to said node

Escuela, estudio y materia

Institución
CMPT 280
Grado
CMPT 280

Información del documento

Subido en
21 de diciembre de 2024
Número de páginas
5
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$11.49
Accede al documento completo:

¿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


Documento también disponible en un lote

Conoce al vendedor

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.
Easton West Virgina University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
571
Miembro desde
3 año
Número de seguidores
221
Documentos
28055
Última venta
5 días hace

3.9

120 reseñas

5
56
4
21
3
25
2
7
1
11

Recientemente visto por ti

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