Explore topic-wise MCQs in Database.

This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Database knowledge and support exam preparation. Choose a topic below to get started.

1.

BREADTH_FIRST_SEARCH_IS_USED_IN?$

A. Binary trees
B. Stacks
C. Graphs
D. All of the mentioned
Answer» D. All of the mentioned
2.

WHICH_OF_THE_FOLLOWING_SCENARIOS_LEADS_TO_LINEAR_RUNNING_TIME_FOR_A_RANDOM_SEARCH_HIT_IN_A_LINEAR-PROBING_HASH_TABLE??$

A. All keys hash to same index
B. All keys hash to different indices
C. All keys hash to an even-numbered index
D. All keys hash to different even-numbered indices
Answer» B. All keys hash to different indices
3.

What is the best definition of a collision in a hash table?

A. Two entries are identical except for their keys
B. Two entries with different data have the exact same key
C. Two entries with different keys have the same exact hash value
D. Two entries with the exact same key have different hash values
Answer» B. Two entries with different data have the exact same key
4.

Key value pairs is usually seen in

A. Hash tables
B. Heaps
C. Both Hash tables and Heaps
D. Skip list
Answer» B. Heaps
5.

A hash table can store a maximum of 10 records, currently there are records in location 1, 3,4,7,8,9,10. The probability of a new record going into location 2, with hash functions resolving collisions by linear probing is

A. 0.1
B. 0.6
C. 0.2
D. 0.5
Answer» C. 0.2
6.

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, _, _, _, _, _, 10
B. 1, 8, 10, _, _, _, 3
C. 1, _, _, _, _, _,3
D. 1, 10, 8, _, _, _, 3
Answer» C. 1, _, _, _, _, _,3
7.

The goal of hashing is to produce a search that takes

A. O(1) time
B. O(n2 )time
C. O(log n ) time
D. O(n log n ) time
Answer» B. O(n2 )time
8.

The searching technique that takes O (1) time to find a data is

A. Linear Search
B. Binary Search
C. Hashing
D. Tree Search
Answer» D. Tree Search
9.

A technique for direct search is

A. Binary Search
B. Linear Search
C. Tree Search
D. Hashing
Answer» E.
10.

If h is any hashing function and is used to hash n keys in to a table of size m, where n<=m, the expected number of collisions involving a particular key x is :

A. Less than 1
B. Less than n
C. Less than m
D. Less than n/2
Answer» B. Less than n