True or False?
1. Duplicate hash codes create collisions.
2. In open addressing with linear probing, a successful search for an entry that corresponds to a given search key could potentially follow a different probe sequence used to add the entry to the hash table.
3. Completely balance binary trees are not necessarily full.
4. A preorder traversal of a binary tree is an example of a depth-first traversal.
Question 1
Duplicate hash codes create collisions.
Ans: True
We can say that whenever two different records or maybe objects share the same hash code, then it will create a collision. In the same way Duplicate hash code which are nothing but 2 objects when having the same hash code creates a collision.
Question 2:
In open addressing with linear probing, a successful search for an
entry that corresponds to a given search key could potentially
follow a different probe sequence used to add the entry to the hash
table.
Ans: False
It is not true that in open addressing with linear probing, whenever a successful search for an entry that corresponds to a given search key could potentially follow a different probe sequence, it may not even follow the probe sequence.
Question 3:
Completely balance binary trees are not necessarily full.
Ans: False
Complete binary trees are the binary trees in which all these levels need to be filled completely excluding the last level. whereas completely balanced binary trees are binary trees in which it follows the following property that a number of nodes in the left subtree must be almost equal to the right subtree. Therefore completely balanced binary trees are necessarily fulled
Question 4:
The preorder traversal of a binary tree is an example of a
depth-first traversal.
Ans: True
In the Depth-first traversal, you will visit all the nodes from the root node and moving as far as possible from the root, without first visiting the siblings node. We can see this case in preorder traversal, Thus we can say that preorder traversal of a binary tree is an example of a depth-first traversal.
(Feel free to drop me a comment, If you need any help)
Hope this Helps!!!
Please upvote as well, If you got the answer?
If not please comment, I will Help you with that...
True or False? 1. Duplicate hash codes create collisions. 2. In open addressing with linear probing,...
Question 8: (a) We create a Hash Table of size 7, using open addressing and linear probing with the hash function h(n)=n%7. Write the content of the array after inserting the following values in sequence: 11, 28,46, 7,67, 88,0. (3 marks) . loj [1] [2] [3] [41-5] 问 (b) Explain the issue linear probing has and how it can be addressed. (3 marks)
Instead of using a linked list to resolve collisions, as in separate chaining, use a binary search tree. That is, create a hash table that is an array of trees. To display a small tree-based hash table, you could use an inorder traversal of each tree. The advantage of a tree over a linked list is that it can be searched in O(logN) instead of O(N) time. This time savings can be a significant advantage if very high load factors...
Implement a StringHash class using python using open addressing and linear probing, it should contain the following methods: Using strings for the data 1. StringHash(size) — create a new hashTable with a default size of 11 for your array, but allow the user to specify an alternate size if desired 2. addItem(string) — place value into the hashTable iv. bool PindItem(string value) — return true if the value is present, else false 3. findItem(string value) — return true if the...
QUESTION 1 In a tree, a ____ is a node with successor nodes. root child descendent parent sibling QUESTION 2 In a tree, the ____ is a measure of the distance from a node to the root. count degree branch height level QUESTION 3 Which of the following is not a characteristic of a binary search tree? Each node has zero, one, or two successors. The preorder traversal processes the node first, then the left subtree, and then the right...