Question

The linked implementation is used in the coding of a Binary Search Tree structure. Calculate the...

The linked implementation is used in the coding of a Binary Search Tree structure. Calculate the structure's density assuming that it contains 200 nodes and:

a.  Each node contains 10 bytes of information.

b.  Each node contains 300 bytes of information.

Then, repeat the above exercise for the array implementation of the Binary Search Tree, assuming it is:

a.  Left balanced.

b.  Skewed to the right.

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

Consider the data:

                    The number of nodes (n) =200

a) The number of bytes per node (w) = 10

     Therefore, the information bytes = 200 * 10 =2000.

      The total bytes = 2000+200 =2200

To calculate the density D,

                           D= (information bytes)/ (total bytes).

                              = 2000/2200

                              = 0.909

b) The number of bytes per node(w) = 300

     Therefore, the information bytes = 200 * 300 =60000.

     The total bytes = 60000+300 =60300

    To calculate the density D,

                           D= (information bytes)/ (total bytes).

                              =60000/(60300)

                              =0.995

Add a comment
Know the answer?
Add Answer to:
The linked implementation is used in the coding of a Binary Search Tree structure. Calculate the...
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
  • A Binary Search Tree is a binary tree where nodes are ordered in the following way:...

    A Binary Search Tree is a binary tree where nodes are ordered in the following way: each node contains one key (also known as data) the keys in the left subtree are less than the key in its parent node the keys in the right subtree are greater than the key in its parent node duplicate keys are not allowed Create a Binary Search Tree inserting the following list of numbers in order from left to right. 10,          6,           4,            8,            18,          15,          21 Please type...

  • Consider the partial implementation of a Binary Search Tree (BST) class. For simplicity, each Node stores...

    Consider the partial implementation of a Binary Search Tree (BST) class. For simplicity, each Node stores only the key. Add a public member function to class BST that returns the largest absolute value in the tree. The language is C++ Want the height #4 Coding [6 points] Consider the partial implementation of a Binary Search Tree (BST) class. For simplicity, each Node stores only the key. Add a public member function to class BST that returns the height of the...

  • A balanced binary tree is a binary tree structure in which the left and right subtrees of every node differ

    Data structures C++1- A balanced binary tree is a binary tree structure in which the left and right subtrees of every node differ in height by no more than 1 Out of the following choices, which is the minimum set of nodes, if removed, will make the BST balanced?2- Which of the following is true for Red-Black Trees ? Select all choices that apply! Select one or more: a. For each node in the tree, all paths from that node to any leaf nodes contain...

  • A collection of nodes is arranged as a binary search tree ordered on the field INFO which contain...

    A collection of nodes is arranged as a binary search tree ordered on the field INFO which contains distinct positive integers for each of the nodes. In addition to INFO, LLINK and RLINK, each node has three other fields CLASS SUCC and PRED CLASS is an information field containing a single letter that denotes the class to which the node belongs (there being up to 26 classes). The nodes in each class are arranged as a doubly-linked circular list with...

  • Need them in c++ 1.       Give the code for the definition  of a node for the  linked  implementation  of a  tree  that  contains...

    Need them in c++ 1.       Give the code for the definition  of a node for the  linked  implementation  of a  tree  that  contains integer data. 2.       In the array implementation of a tree in C, if the data for anode in in  index i,  what  are the indices  of  its  two  children? 3.        Draw the binary search treethat resultsfor insertingthe following numbers, in the order given, into aninitially empty tree:   64,  14,  23,  84,  67,  2,  8,  73,  89,  47. 4.       Describe, in detail, the algorithm for deleting a node from a binary search tree.   (make sure you have differentcases fornodes with 0,  1,  or  2  children.

  • C++, data structure using :binarySearchTree Deleting an element from a binary search tree is far more complicated than i...

    C++, data structure using :binarySearchTree Deleting an element from a binary search tree is far more complicated than inserting an element in a binary search tree. An analysis of binary search tree deletion finds 4 cases: Case 1: The node to be deleted has no left and right subtrees Case 2: The node to be deleted has no left subtree but does have a right subtree. Case 3: The node to be deleted has no right subtee but does have...

  • Coding Language: C++ Function Header: vector<vector<int>> printFromButtom(TreeNode* root) {} Definition for a binary tree node: struct...

    Coding Language: C++ Function Header: vector<vector<int>> printFromButtom(TreeNode* root) {} Definition for a binary tree node: struct TreeNode { int val; TreeNode *left; TreeNode *right; }; The Problem Complete the printFromButtom function that accepts a BST TreeNode and returns the nodes' value from left to right, level by level from leaf to root. This function will return vector<vector int which similar to a 2-D array. Function std: reverse (myvector.begin myVector en might be helpful. Definition for a binary tree node: struct...

  • Given the follow Binary Search Tree (AVL Tree). Show the balance factor for each node. Is...

    Given the follow Binary Search Tree (AVL Tree). Show the balance factor for each node. Is this binary tree balanced? If not which nodes would have to be removed to make it balanced?   

  • Read a list of names from a file. Insert the names into a binary search tree...

    Read a list of names from a file. Insert the names into a binary search tree that is a little different from what we discussed in class. For this tree, the left side will contain the larger values and the right side will contain the smaller values. In essence, it is the exact opposite of a normal binary search tree. Our tree will also be able to store duplicate names. Aside from a left and a right pointer for each...

  • Complete in Java : Question 2: Write a program that can convert a sorted array into...

    Complete in Java : Question 2: Write a program that can convert a sorted array into a balanced binary search tree. A binary search tree is a balanced binary search tree if the size of the left and right subtree at each node differs by at most one. The size of the left subtree is defined as the number of nodes in the left subtree. The size of the right subtree is defined as the number of nodes in the...

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