Question: Data structure type 2: Array of AVL trees or linked lists In Java8, a similar structure is kept, but, when a position in the array


Data structure type 2: Array of AVL trees or linked lists In Java8, a similar structure is kept, but, when a position in the array (bucket) contain a linked list with 8 elements, the linked list is substituted by a balanced binary search tree to store the keys in that bucket. If after deletions the balanced search tree at a position contains 6 or less elements, then the tree is transformed back into a linked list. Assume each balanced binary search tree used is an AVL tree (Java uses a red-black trees, but either type of tree is balanced, i.e, has height O(log b) if the tree contains b nodes) Details about this class and its methods can be found here https://docs.oracle.com/javase/8/docs/apijava/util/HashMap.html ndex 0 index 1 index 2 index 3 array of linked lists or treesNode Anull (called buckets/bins) Node B Node MnulNode J Node C Node D Node O Node P Node X Node ENode K Node FNode Q null tree linked lists Data structure type 2: Array of AVL trees or linked lists In Java8, a similar structure is kept, but, when a position in the array (bucket) contain a linked list with 8 elements, the linked list is substituted by a balanced binary search tree to store the keys in that bucket. If after deletions the balanced search tree at a position contains 6 or less elements, then the tree is transformed back into a linked list. Assume each balanced binary search tree used is an AVL tree (Java uses a red-black trees, but either type of tree is balanced, i.e, has height O(log b) if the tree contains b nodes) Details about this class and its methods can be found here https://docs.oracle.com/javase/8/docs/apijava/util/HashMap.html ndex 0 index 1 index 2 index 3 array of linked lists or treesNode Anull (called buckets/bins) Node B Node MnulNode J Node C Node D Node O Node P Node X Node ENode K Node FNode Q null tree linked lists
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
