Spring 2026 — Assignment 5

Due 15-April-2026, 1pm EST (before class)
Purpose:

For this assignment, you may work individually or with at most 3 partners (max group size = 4). We strongly encourage you to work with partner(s) as different query designers typically have different perspectives. Besides, you can learn from each other.

Answer the following questions / complete the following tasks. All homework assignments are due before class on the due date. Please remember that the UVA Honor Code is in effect.


Note on handwriting and hand drawing

For this assignment, you may write your answers by hand ** neatly **

You may draw your B+ trees by hand, take pictures, and embed them in your report. Do not submit the pictures separately. Submit a single report containing all of your answers, and save your report as a .pdf file.

**Draw/write legibly**. we have to deduct points if we are unsure what you drew/wrote.


[Total: 100 pts.]

  1. [34 points] Consider the following B+ tree of order n = 4 (where n is the number pointers). Make the following assumptions: in case of underflow, if you can borrow from both siblings, choose the one on the right


    (the given tree will later be referred to as the original tree)

    1. (2 pts.) What is the minimum number of pointers to be followed to satisfy the query: Get all records with key(s) between 39 and 56, inclusive?
      You should count only pointers from parent node to child node and pointers from sibling node to sibling node. Not key to actual data on the physical disk.
      Circle one
      a.  1 pointer 
      b.  2 pointers  
      c.  3 pointers  
      d.  4 pointers        
      e.  5 pointers 
      f.  None of the above 
    2. (4 pts.) Insert a key value (24, val) into the original tree. Show the content of the tree after the insertion.
    3. (10 pts.) Insert key values (24, val), and then (36, val) into the original tree. Show the content of the tree after the insertion.
    4. (8 pts.) Delete a key value (20, val) from the original tree. Show the content of the tree after the deletion.
    5. (10 pts.) Delete a key value (56, val) from the original tree. Show the content of the tree after the deletion.
  2. [10 points] Consider a partially filled B+ tree — root value(s) missing.

    B+ tree for hw5, question 1

    1. (4 pts.) Fill in the value(s) present in the root of the tree.
    2. (6 pts.) There are many sequences of exactly 3 insertions that will cause the root node in the given B+ tree (above) to split. List one such sequence of three insertions, and briefly justify your choice.
  3. [6 points] Consider B+ trees with different orders (that is, different n, where n is the number of pointers).
    1. (2 pts.) Which tree is more appropriate when the transactions to be executed against the database are mostly selection (data retrieval), and less insertion/updating/deletion? Circle one
      a. The B+ tree with bigger n
      b. The B+ tree with smaller n    
    2. (4 pts.) Briefly justify why the B+ tree you chose is more appropriate.
  4. [10 points] Construct a B+ tree for the following set of key values:
    (2, 3, 5, 7, 11, 17, 19, 23, 29, 31)

    Assume that the tree is initially empty and values are added in ascending order. Construct a B+ tree for the case where the number of pointers (n) that will fit in one node is four (i.e., n = 4).

  5. [40 points] Use the B+ tree from question 4, apply each of the following operations in order, and show the tree after each operation.
    1. (8 pts.)   Insert 9.
    2. (8 pts.)   Insert 10.
    3. (8 pts.)   Insert 8.
    4. (8 pts.)   Delete 23.
    5. (8 pts.)   Delete 19.

Late submission

To grade and record your assignment efficiently, the following details apply to all homework assignments, unless otherwise specified.


Submission

Include all team member names and computingIDs in the report.

Save your report as a PDF.  No Word document.

Each team submits only one copy.

Upload your report as a PDF to the Assignment 5 on Gradescope. Make sure you connect your partner to your group on Gradescope so that everyone receives credit.

Making your submission available to the course staff is your responsibility; if we cannot access or open your file, we have to assign a zero grade. Be sure to test access to your file before the due date.



Copyright © 2026 Upsorn Praphamontripong
Released under the Creative Commons License CC-BY-NC-SA 4.0 license.
Last updated 2026-04-05 19:32