Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A HashMap with a perfect hash function can search for an item in time 0 (n^2) 0(

ID: 3775890 • Letter: A

Question

A HashMap with a perfect hash function can search for an item in time 0 (n^2) 0(n) 0 (log n) 0 (c) If the following value pairs are put into a TreeMap as follows: frunch, put ("dog, " "checn"); frunch, put ("cold, " "froid"); frunch, put ("Sun", "Soleil"); the keys will come out in the order: Chien, froid, Soleil dog, cold, sun Cold, Dog, Sun the orger is unknown. Which regular expression should be used to negognise 3-6 word characters followed by one or more digests followed by 2 - 4 characters? |w {3, 6}d + w{2, 4} w {3, 6}d *w {2, 4} d * w + d* d {3, 6} w + d {2, 4} If a class does not implement all the methods in an interface, then all the methods in that class become abstract all the class becomes abstracts a super method is not necessary, There will be a error message from the compiler.

Explanation / Answer


4.a.
   Ans: D. O(c) : constant time

   HashMap is a data structure that is designed to improve search
   time to constant time. If we have perfect hash functions then there will be very less posibility for collision(always compute different hash value
   for different keys to be inserted in hash map).

4.b.
   Ans: C. cold, dog, sun

   Because TreeMap maintains order by key.

4.c.
   Ans: A. w{3,6}d+w{2,4}
  
4.d.
   Ans: D. There will be a error message for the compiler

   If a class does not implements all the methods of an interface, then in this case:
       1. Either that class should be declared as abstract
   OR 2. Compiler will throw compile time errors

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote