Question

Draw the diagrams on the file to be uploaded at the end of the exam. Please be neat, if it cannot be read, it cannot be grade

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Q2 PART A:

We are assuming that the maximum number of keys allowed is 4 and the minimum number of keys allowed is 2.

If this is the case then the after deleting 17 from the root, the node will be left with only one key i.e. 15 which violates the property of the B+ tree (underflow).

Thus we borrow one key from the siblings through the root.

As the left sibling of the root contains more number of keys than the right sibling, we will borrow from the left sibling.

As we are borrowing from the left sibling, so we will borrow the maximum key i.e. 8.

Now after shifting 8, the value of the root key 14 cannot be there as in B+ tree the right child keys should be >= the root key and left child keys should be < the root key.

So, we will replace the root key 14 with the minimum key of the right child i.e. 8.

So, the resulting key will be as follows:-

= || is [as [fast [[[[[[[[[[[[_LI [[ি =_[] [] = [s|p.[[[_LL

Q2 PART B:

As the new tree from part A) has a space left for data entry 7* (no overflow) i.e. in the leftmost leaf, therefore, we need to do nothing and just insert 7 after 6 in the leftmost node. All the properties of the B+ tree will remain intact after the insertion. So, the new tree after inserting 7 will be as follows:-

Elie 2 ) | |- | PT] [ure | ||CCI | | | D | | | Fan is | | CCD

Add a comment
Know the answer?
Add Answer to:
Draw the diagrams on the file to be uploaded at the end of the exam. Please...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Show all your work and the answers on the file to be uploaded at the end...

    Show all your work and the answers on the file to be uploaded at the end UI LI Clearly label your exam document. Using two relations Rand S, with the join condition Ri - Sj, and given the following information: . Mpages in R with PR tuples per page • N pages in Swith pS tuples per page Rcontains: 550 pages, 20 tuples per page S contains: 300 pages, 15 tuples per page Buffer size is 52 (inclusive of 2...

  • • P1 (10 pts) Show the result of inserting 2, 9, 5, 8, 6, 4, 3,...

    • P1 (10 pts) Show the result of inserting 2, 9, 5, 8, 6, 4, 3, 1 into an initially empty AVL tree (draw a resulting tree after inserting each number; you need to draw 8 AVL trees). • P2 (5 pts) What is the minimum number of nodes in an AVL tree of height 8? • P3 (5 pts) Show the result of deleting the element with key 9' from the following splay tree. • P4 (5 pts) Show...

  • Q2: Imagine that you are uploading a file of 1664MB into HDFS (Hadoop 2.0). 8 blocks are successfully uploaded into HDFS Please find how many blocks are remaining. (block size of Hadoop 2.0 is 128MB) • Another client wants to work or read the upload

    Q2: Imagine that you are uploading a file of 1664MB into HDFS (Hadoop 2.0). 8 blocks are successfully uploaded into HDFS Please find how many blocks are remaining. (block size of Hadoop 2.0 is 128MB)•     Another client wants to work or read the uploaded data while the upload is still in progress i.e., data which is updated in 8 blocks. What will happen in such a scenario, will the 8 blocks of data that is uploaded will it be displayed...

  • USING PYTHON PLEASE 5. Consider a text file in which the only characters that appear are...

    USING PYTHON PLEASE 5. Consider a text file in which the only characters that appear are the letters "A", "B", "C", and "D" with the distribution 17%, 35%, 26%, and 22%, respectively. (To clarify, this means that 17% of the characters in the file are the letter "A", 35% are the letter "B", etc.) Using the technique demonstrated in class, construct the Huffman tree for this file (and don't forget to label the edges with 0 or 1 such that...

  • (c) Draw the binary heap structure that is equivalent to the following list (the root is...

    (c) Draw the binary heap structure that is equivalent to the following list (the root is first element). [5, 9, 8, 12, 15, 11, 19, 14, 20, 18, 17, 13] [4 marks] (d) Show the resulting tree after the value 6 is added to the heap in the part (c). Note that the binary heap properties must be restored after insertion. Show your working; you may show the data structure in tree or array form. [3 marks]

  • B trees java NAME CSC 236 HW #3 (B-trees & heaps) 1. Given a B-tree of...

    B trees java NAME CSC 236 HW #3 (B-trees & heaps) 1. Given a B-tree of order 5, add the elements 1, 12, 8, 2, 25, 5, 14, 28, 17, 7, 52, 16, 48, 68, 3, 26, 29, 53, 55, 45 into a B-tree in this order. Draw the diagrams to show the B-tree after each element is added. 2. Add the elements 27, 35, 23, 22, 4, 45, 21, 5, 42, 19 into a heap in this order Draw...

  • 3. (8 points) Using the implementation of binary search tree operations we discussed in class, draw...

    3. (8 points) Using the implementation of binary search tree operations we discussed in class, draw the trees that result from the following operations: (a) Inserting 142, 400, 205, 127, 100, 320, 160, 141, and 110 into an initially-empty tree (in that order). (b) Deleting 142 from the tree you drew for part (a). 4. (8 points) Draw the unique binary tree that has a preorder traversal of 4, 1, 6, 3, 7, 5, 9, 2, 8 and an inorder...

  • Please help me with my practice exam! lecular orbital diagram (diagrams provided are for the I...

    Please help me with my practice exam! lecular orbital diagram (diagrams provided are for the I them correctly) to answer questions 15-16. A table is xalence shell only, you may want to label the MOs so you fill provided to help organine your data For each species in the table, use an appropriate mo Species Bond orderMagnetism Ho A. C. Ca 15. The mast parannagnetic species (c,to". c, cr) is: 16. The species (Ca, Co"C,C) with the shortest bond length...

  • Use C++ For this week’s lab you will write a program to read a data file...

    Use C++ For this week’s lab you will write a program to read a data file containing numerical values, one per line. The program should compute average of the numbers and also find the smallest and the largest value in the file. You may assume that the data file will have EXACTLY 100 integer values in it. Process all the values out of the data file. Show the average, smallest, largest, and the name of the data file in the...

  • 5. Hashing (a) Consider a hash table with separate chaining of size M = 5 and...

    5. Hashing (a) Consider a hash table with separate chaining of size M = 5 and the hash function h(x) = x mod 5. i. (1) Pick 8 random numbers in the range of 10 to 99 and write the numbers in the picked sequence. Marks will only be given for proper random numbers (e.g., 11, 12, 13, 14 ... or 10, 20, 30, 40, .. are not acceptable random sequences). ii. (2) Draw a sketch of the hash table...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT