please answer the following with explanations. Thank you
1)
2)
3)
You have a large amount of values that you wish to repeatedly search. Which of these structures is most appropriate to reduce worst-case time complexity? A. max heap B. list O c. array O D. binary search tree
Which of these is true about hashing? O A. It makes search slower B. When a modulus of k is used, it produces k slots C. It is guaranteed to avoid collisions D. Hash functions are equivalent to minheaps
What is the complexity class of the following method? Provide a clear rationale of your response, regarding the input size and the critical operation(s). def randomElement(list): i = 0 j = len(list) while (i < j): k = int((i+j) / 2) if (random.random() < 0.5): i = k + 1 else: j = k return list
please answer the following with explanations. Thank you 1) 2) 3)
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am