100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

CSC148 section 8 Study Questions with Complete solutions

Puntuación
-
Vendido
-
Páginas
7
Grado
A+
Subido en
07-09-2024
Escrito en
2024/2025

CSC148 section 8 Study Questions with Complete solutions

Institución
CSC148
Grado
CSC148









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CSC148
Grado
CSC148

Información del documento

Subido en
7 de septiembre de 2024
Número de páginas
7
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

CSC148 section 8 Study Questions with
Complete solutions

what is the drawback of the 'looping-through-all-items' search algorithm?

note: this drawback is shared with the tree.__contains__ method - ANSWER in the case of an
unsuccesful search, every item of the list is checked



this is a linear time operation: the time taken for an unsuccessful search grows
proportionally with the length of the list!



what is the efficient search algorithm that can be implemented on sorted lists? - ANSWER
binary search



what is the drawback of binary search due to the fact that it is based on Python's array-
based lists? - ANSWER insertion and deletion still has problems



the following still happens when adding/removing elements that are NOT at the end of sorted
lists:

, - shifting of elements during insertion
- shifting of elements during deletion


binary tree - ANSWER tree in which every item has at most two subtrees / children


an item in a binary tree satisfies the binary search tree property if... - ANSWER its value is
(1) greater than or equal to all items in its left subtree
(2) less than or equal to all items in its right subtree



a binary tree is a binary search tree (BST) if... - ANSWER every item in the tree satisfies the BST
property



state an advantageous inherent property of BSTs - ANSWER natural sorting: BSTs
inherently organize data in a sorted manner, even if input data was not sorted


BSTs are extremely efficient in __________ AND __________ AND __________ - ANSWER
searching AND insertion AND deletion


in the BinarySearchTree class, which 3 attributes are set to None if a BST is empty? - ANSWER
(1) _root
(2) _left
(3) _right



in the BinarySearchTree class, what is the ONLY case where any of the attributes of a BST
can be set to None? - ANSWER in the case that the BST is empty


a NON-EMPTY BST can have its _left and _right attributes refer to __________ (which is
different from these attributes being set to None) - ANSWER empty BSTs
$12.79
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

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.
KenAli West Virginia University
Ver perfil
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
84
Miembro desde
1 año
Número de seguidores
5
Documentos
17177
Última venta
3 semanas hace

2.9

19 reseñas

5
4
4
4
3
4
2
0
1
7

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