preview

Java And Jav Rename To Bpplustree Class Assumptions

Decent Essays

import java.io.*; import java.util.*; /** * BPlusTree Class Assumptions: 1. No duplicate keys inserted 2. Order tree_degree: * tree_degree<=number of keys in a node <=2*tree_degree 3. All keys are non-negative * TODO: Rename to BPlusTree */ public class b_plus_tree { public node root; public static int tree_degree; /** * TODO Search the value for a specific key * * @param key * @return value */ public ArrayList (-- removed HTML --) value_search(Double key) { // Return if empty tree or key if(key == null || root == null) { return null; } // Look for leaf node that key is pointing to leaf_node leaf = (leaf_node)tree_search(root, key); …show more content…

ey); } } } return null; } } /** * TODO Insert a key/value pair into the BPlusTree * * @param key * @param value */ public void tree_insert(Double key, String value) { if (root != null && value_search(key) != null ){ // Look for leaf node that key is pointing to leaf_node leaf = (leaf_node)tree_search(root, key); // Look for value in the leaf for(int i=0; i

Get Access