Question

In: Computer Science

DEPTH counting starts at 1 at the root. How many total nodes does a 7-ary tree...

DEPTH counting starts at 1 at the root.

How many total nodes does a 7-ary tree have if its depth is 8?

Hash the given file (6,22,9,14,13,1,8) and use linear probing and the table size of 11. How many total collisions occurred? What is the loading density of the table?

Solutions

Expert Solution

1. A 7-ary tree is a tree in which nodes can have at most 7 children.

We assume the tree is a complete tree with all nodes have 7 children till depth 8.

so the calculation goes like this

node at depth 1 (root node) - 1 node = 70

nodes at depth 2 = 71 = 7 nodes

nodes at depth 3 = 72 = 49 nodes

.......................................

.................

nodes at depth 8 = 77 = 823543 nodeshash

so total nodes = 70 + 71 + 72 + ...................+ 77 = 960800 nodes

2.

The file contains 7 numbers and table size is 11

elements = (6,22,9,14,13,1,8)

In linear probing hash key = data % size

key1 = 6%11 = 6

key2 = 22%11 = 0

key3 = 9%11 = 9

key4 = 14%11 = 3

key5 = 13%11 = 2

key6 = 1%11 = 1

key7 = 8%11 = 8

our hash table =

index value
0 22
1 1
2 13
3 14
4
5
6 6
7
8 8
9 9
10

We can see there is 0 collisions

load factor = number of keys to be inserted in the table / number of slot in the hash table

here it is 7/11


Related Solutions

DEPTH counting starts at 1 at the root. What should the loading factor be (on ANY...
DEPTH counting starts at 1 at the root. What should the loading factor be (on ANY HASH TABLE) if you want to have an average of 1.4 comparisons per successful search if LINEAR PROBING?
DEPTH counting starts at 1 at the root. Q1 [20 pts.]: Given the following key sequence...
DEPTH counting starts at 1 at the root. Q1 [20 pts.]: Given the following key sequence (6,22,9,14,13,1,8) build the dynamic binary search tree WITHOUT BALANCING IT. How many probes (i.e., comparisons) does it take to determine that key 100 is not in the tree? (In this study case, the root is 6; the next element 22 > 6, so it goes to the right, etc).
A binary tree model with 7 decision nodes will have how many terminal nodes?
A binary tree model with 7 decision nodes will have how many terminal nodes?
How many spherical nodes and planar (angular) nodes does a 2s orbital have? 0, 1 0,...
How many spherical nodes and planar (angular) nodes does a 2s orbital have? 0, 1 0, 0 2, 1 1, 0 2, 0
a) How many arrangements of all the letters in AABBCCD starts with A but does not...
a) How many arrangements of all the letters in AABBCCD starts with A but does not end with A? b) Find the number of arrangements of all the letters in AABBCCD in which none of the patterns AA, BB or CC occurs.
Show that every 2-tree with n internal nodes has n+ 1 external nodes
Show that every 2-tree with n internal nodes has n+ 1 external nodes
10) A binary tree with N nodes is at least how deep? How deep is it...
10) A binary tree with N nodes is at least how deep? How deep is it at most? 12) A Binary Search Tree is a binary tree with what additional property? 13) Beginning with an empty binary search tree, insert the following values in the order given. Draw the tree at each step of the process. 1 10 5 20 22 7 14) Now delete the value 10 from the tree in question 13. Show each of two possible configurations...
Prove that a full m-ary tree of height h has at least h(m − 1) leaves.
Prove that a full m-ary tree of height h has at least h(m − 1) leaves.
1. Draw a binary search tree as a single root node holding a string as the...
1. Draw a binary search tree as a single root node holding a string as the data element. Each string inserted into a node in the tree will be for a character in a game. Then, draw a new tree each time you insert a new node into the tree holding a string Insert 4 nodes total, including the root. This means the new nodes will need to be inserted at the correct child to maintain the BST property.
A company produced 2100 units in 7 months. 1. On average how many units does the...
A company produced 2100 units in 7 months. 1. On average how many units does the company produce per month? 2.Does that mean it produced 300 units in each month? Or even 10 units on each day? 3. Explain why 2100 units in 7 months does not imply exactly 300 units each month?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT