WorksheetsHash Tables & Other Data Structures
Total questions: 35
Worksheet time: 18mins
Hashing gives each item
A sequential address
A logarithmic address
No address
A unique address
A hash table is
an abstract data structure
an array
an integer
made of pine
Address <----- key MOD(numberOfSlots)
IF KEY = 5432 and numberOfSlots = 1000
Address = ?
5
432
543
5432
When an algorithm generates the same address for different primary keys it is known as
Knock
Bang
Collisions
DoubleHash
What is the status after adding 10
What is the status after adding 7
What does the term immutable mean?
unable to be changed
unable to speak
can be modified
can be increased in size
Which data structure cannot have elements of different data types?
Array
Tuple
Record
Stack
Queue
In terms of data structures, what does mutable mean?
A mutable structure is one which can only have data added to it
A mutable structure is one which is fixed in size
A mutable structure is one which allows data to be added, edited, deleted or moved
What type of data structure is an array?
Static and mutable
Dynamic and immutable
Static and immutable
In terms of an array, what is an index?
A value which points to a data element in an array
The first element in an array
A list of all the elements in an array
Which mathematical function do all hashing algorithms use?
MOD
DIV
EXP
COS
RAND
In this binary tree, where would the new value "7" be placed?
Which word means storing data in sequence, next to each other?
contiguous
contrary
quantitative
immutable
When a collision occurs with a hashing function, what is one method for dealing with the collisions?
creating a new list at that index
creating a new array
creating a new hash table
creating a new binary tree
Which word describes a lot of collisions with using hashing?
contiguous
traffic
clustering
mutable
Which of these is the correct code for creating a list of names?
nameList = John, Harry, Jesse, John, Harry, Harry
nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList = [John, Harry, Jesse, John, Harry, Harry]
Which symbol surrounds a Python dictionary?
{
(
[
:
Which of these are operations of a stack?
Push
Add
Remove
Pop
Which of these is not a data structure?
Stack
Array
Integer
List
A stack is last in, "what" out?
(a)
What is the value of the ROOT node in this Tree?
35
24
42
20
Consider the following operation performed on a stack of max size 5.
Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operation, the no of element present on stack are
1
3
2
4
Records allow you to store more than one data type
True
False
A hash table will generally take longer to search as more data is added
True
False
A hash table can access the data directly, without having to traverse through previous links in the structure
True
False
What is the goal of a hash table?
To compare items in a data set
To store all the data items
To immediately find an item without comparing other items
To implement a dictionary data structure
What is a hashing function used for?
To calculate the position of an item in a hash table
To determine the size of a hash table
To compare items in a data set
To implement a dictionary data structure
What is a collision in a hash table?
When two data items have the same hash value
When a hash table is too small to store all the data items
When a hashing function takes too long to calculate
When a hash table is empty
What is a disadvantage of linear probing?
It prevents other items from being stored in their correct location
It requires a large amount of memory
It results in a high number of collisions
It is a slow method of resolving collisions
What is chaining in a hash table?
Storing items in a linked list
Using a two-dimensional hash table
Searching sequentially in an overflow table
Finding an alternative position for items in the hash table
What are the three basic operations that can be performed on a hash table?
Adding a value, deleting a value, retrieving a value
Sorting a value, searching a value, updating a value
Copying a value, moving a value, renaming a value
Creating a value, reading a value, updating a value
