Search Header Logo

DSA Quiz 2

Authored by Arikumar K S

Computers

University

Used 4+ times

DSA Quiz 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider a hash table of size seven, with starting index zero, and a hash function (7x+3) mod 4. 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 ? Here “__” denotes an empty location in the table.

3, 10, 1, 8, __ , __ , __
1, 3, 8, 10, __ , __ , __
1, __ , 3, __ , 8, __ , 10
3, 10, __ , __ , 8, __ , __

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the worst case complexity for linear search?

O(nlogn)
O(logn)
O(n)
O(1)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of binary search with iteration?

O(nlogn)
O(n)
O(1)
O(logn)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given an array arr = {45,77,89,90,94,99,100} and key = 100; What are the mid values(corresponding array elements) generated in the first and second iterations using binary search?

90 and 99
89 and 94
90 and 100
94 and 99

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The case in which a key other than the desired one is kept at the identified location is called?

Hashing
Chaining
Open addressing
Collision

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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 above. Which one of the following choices gives a possible order in which the key values could have been inserted in the table?

46, 42, 34, 52, 23, 33
34, 42, 23, 52, 33, 46
42, 46, 33, 23, 34, 52
46, 34, 42, 23, 52, 33

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the worst case search time of a hashing using separate chaining algorithm?

O(N log N)
O(N^2)
O(N^3)
O(N)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?