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

EO2 Paper with Answers

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

EO2 Paper with Answers

Vista previa del contenido

Review Test Submission: Examination
Opportunity 2
Course COS 212 S1 2020
Test Examination Opportunity 2
Started 6/11/20 5:30 PM
Submitted 6/11/20 7:30 PM
Due Date 6/11/20 7:40 PM
Status Completed
Attempt 20.41666 out of 40 points
Score
Time 2 hours, 0 minute out of 2 hours
Elapsed
Instruction The University of Pretoria commits itself to produce academic
s
work of integrity. I affirm that I am aware of and have read the
Rules and Policies of the University, more specifically the
Disciplinary Procedure and the Tests and Examinations Rules,
which prohibit any unethical, dishonest or improper conduct
during tests, assignments, examinations and/or any other
forms of assessment. I am aware that no student or any other
person may assist or attempt to assist another student, or
obtain help, or attempt to obtain help from another student or
any other person during tests, assessments, assignments,
examinations and/or any other forms of assessment.
Results Submitted Answers, Feedback, Incorrectly Answered Questions
Displayed


 Question 1
2 out of 2 points
Consider the B-tree in Figure 1:




Assume value 55 is inserted into the B-tree shown on Figure 1. Since insertion in B-
trees always happens at leaf level, 55 will be inserted into some leaf node. What
values will the parent of this leaf node contain after the insertion has taken place?
Selected f.
Answer: [26, 45]
 Question 2
2 out of 2 points

, Consider the B-tree in Figure 1:




Assume value 55 is inserted into the B-tree shown in Figure 1. What values will the
root node contain after the insertion has taken place?
Selected f.
Answer: [60]
 Question 3
0 out of 4 points
Consider the following BTreeNode and BTree classes:
public class BTreeNode {
int maxKeys; // Maximum number of keys that can be stored
int numberOfKeys; // Number of keys currently stored
Integer[] keys; // Integer key values
BTreeNode[] children; // Pointers to children (children are all null
in leaves)

// Create a BTreeNode that can store n keys
BTreeNode(int n) { ... }
// Find value, starting the search from this node
// If value found in the node, return pointer to child node
to the left of value
// Otherwise, return null
BTreeNode findLeftChild(Integer value) { ... }

// If value is contained in non-leaf node, return immediate
predecessor
// Otherwise, return null
Integer immediatePredecessor(Integer value) {
// provide your implementation here
}
}

public class BTree {
BTreeNode root;
int maxKeys;

// Create a BTree that can store n keys
BTree(int n) { ... }

// Insert value into this BTree
void insertInteger(Integer value) { ... }

// Delete value from this BTree
void deleteInteger(Integer value) { ... }
}
Complete the provided immediatePredecessor method. You may assume that
all the other provided methods in the BTreeNode and BTree classes are

Información del documento

Subido en
7 de junio de 2022
Número de páginas
13
Escrito en
2020/2021
Tipo
Examen
Contiene
Preguntas y respuestas
$12.34

¿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

Vendido
0
Seguidores
0
Artículos
0
Última venta
-




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