0% found this document useful (0 votes)
99 views5 pages

B. A Structure That Maps Keys To Values: B. Size of Elements Stored in The Hash Table

A hash table maps keys to values. The factors that affect the efficiency of lookups in a hash table include the number of elements stored, the size of the buckets, and the quality of the hash function. A binary tree is a heap if it has a specific structure and satisfies the heap order property. When elements are inserted into an empty hash table using open addressing with a given hash function and linear probing, there are multiple possible orders in which the elements could have been inserted to result in the shown table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views5 pages

B. A Structure That Maps Keys To Values: B. Size of Elements Stored in The Hash Table

A hash table maps keys to values. The factors that affect the efficiency of lookups in a hash table include the number of elements stored, the size of the buckets, and the quality of the hash function. A binary tree is a heap if it has a specific structure and satisfies the heap order property. When elements are inserted into an empty hash table using open addressing with a given hash function and linear probing, there are multiple possible orders in which the elements could have been inserted to result in the shown table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

What is a hash table?

A. A structure that maps values to keys


B. A structure that maps keys to values
C. A structure used for storage
D. A structure used to implement stack and queue

There are several factors that affect the efficiency of lookup operations in a hash table. Which of the
following is not one of those factors?

A. Number of elements stored in the hash table

B. Size of elements stored in the hash table


C. Number of buckets in the hash table

D. Quality of the hash function 17.

E. All of the above factors affect the efficiency of hash table lookups

What are the two properties that make a binary tree a heap?

a. Structure and size

b. Structure and order

c. Order and size

d. Order and height

e. Height and size

A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing.
After inserting 6 values into an empty hash table, the table is as shown below

0 1 2 3 4 5 6 7 8 9
42 23 34 52 46 33
Which one of the following choices gives a possible order in which the key values could have been
inserted in the table?

A : 46, 42, 34, 52, 23, 33

B : 34, 42, 23, 52, 33, 46

C : 46, 34, 42, 23, 52, 33


D : 42, 46, 33, 23, 34, 52

Consider a hash table of size seven, with starting index zero, and a hash function (3x + 4)mod7.
Assuming the hash table is initially empty, which of the following is the contents of the table when the
sequence 1, 3, 8, 10 is inserted into the table using closed hashing? Note that ‘_’ denotes an empty
location in the table.

A : 8, _, _, 1, 3, _, 10

B : 1, 8, 10, _, _, _, 3
C : 1, _, _, 8, 10, _,3

D : 1, 10, 8, _, _, _, 3

Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod
10, which of the following statements are true?

i. 9679, 1989, 4199 hash to the same value


ii. 1471, 6171 has to the same value
iii. All elements hash to the same value
iv. Each element hashes to a different value

A : i only

B : ii only

C : i and ii only
D : iii or iv

Which of the following statement(s) is TRUE?

1. A hash function takes a message of arbitrary length and generates a fixed length code.

2. A hash function takes a message of fixed length and generates a code of variable length.

3. A hash function may give the same hash value for distinct messages

A :I only

B : II and III only

C: I and III only


D : II only

Which one of the following array elements represents a binary min heap?
12 10 8 25 14 17

8 10 12 25 14 17
25 17 14 12 10 8

14 17 25 10 12 8

What will be the position of 5, when a max heap is constructed on the input elements 5, 70, 45, 7,
12, 15, 13, 65, 30, 25?

5 will be at root

5 will be at last level


5 will be at second level
5 can be anywhere in heap
Heap can be used as ________________

A. Priority queue
B. Stack
C. A decreasing order array
D. Normal Array

A ________ is a special Tree-based data structure in which the tree is a


complete binary tree.?
A. Graph
B.Heap
C. List
D. Stack

Construct a min heap from the following sequence of integer elements 120 140
40 50 80 70 60 90 20 100 After deleting a root element from the heap, what will
be the post order traversal of the heap?
140 90 100 50 80 40 120 60 70
140 100 90 80 50 40 120 60 70

140 100 90 80 120 70 50 60 40

40 100 90 80 50 120 70 60 140

 If a node having two children is to be deleted from binary search tree, it is
replaced by its

a) In-order predecessor
b) In-order successor
c) Pre-order predecessor
d) None
A binary search tree is generated by inserting in order the following
integers:
50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24

The number of the node in the left sub-tree and right sub-tree of the root,
respectively, is

a) (4, 7)
b) (7, 4)
c) (8, 3)
d) (3, 8)

You might also like