Computer Science, asked by vidushisharma1311, 19 days ago

Vjay is given a problem to solve. He is given an array of names and asked to find duplicates in the
names Vijay builds a hashtable with all the names and uses that to find duplicates. Which of the
following statements are true? (Unless otherwise stated, assume that the hash-function and hash-table
are working well and doing a good job.)
Pick all that apply
In most cases, the program will run in O(n) time
In most cases, the program will run in Oin log n) time
In most cases, the program will run in Oin2) time
If the hash-function is a doing a bad job, and there are lots of collisions, the program will run
in Oin log n) time
If the hash-function is a doing a bad job, and there are lots of collisions, the program will run
in Oin) time
Submit

Answers

Answered by bhushanjijivanwal
3

Answer:

In most cases ,the program will run in O(n) time

Answered by anjaliom1122
4

Answer:

Vjay is given a problem to solve. He is given an array of names and asked to find duplicates in the names Vijay builds a hashtable with all the names and uses that to find duplicates. As a result, all programmers must have a solid understanding of data structures and algorithms.

Explanation:

If you are new to programming or want to brush up on essential data structures such as an array, string, linked list, hash table, binary tree, balanced tree, stack, queue, priority queue, and so on, I recommend taking a comprehensive data structure and algorithms course.

This problem has an O(n2) or quadratic time complexity. When you present this solution to your interviewer, he will almost certainly ask you to develop an O(n) time complexity algorithm, so the hash-function is a doing a bad job, and there are lots of collisions, the program will run in O(n) time.

Similar questions