answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
saul85 [17]
1 year ago
13

A police department wants to maintain a database of up to 1800 license-plate numbers of people who receive frequent tickets so t

hat it can be determined very quickly whether or not a given license plate is in the database. Speed of response is very important; efficient use of memory is also important, but not as important as speed of response. Which of the following data structures would be most appropriate for this task?
a. a sorted linked list
b. a sorted array with 1,800 entries
c. a hash table using open addressing with 1,800 entries
d. a hash table using open addressing with 3,600 entries
e. a hash table using open addressing with 10,000 entries
Computers and Technology
1 answer:
maksim [4K]1 year ago
6 0

Answer:

c.

Explanation:

I believe that in this scenario, the best option for this data would be a hash table using open addressing with 1,800 entries. Hash tables consume more memory than lists but it makes up for it with much faster response time speeds. This is because hash tables work on a key:value system therefore, the license plate can easily be grabbed from the database extremely quickly by just plugging in the plate number. Doing so will retrieve all of the saved information from that license plate. That is why hash tables have a constant time complexity of O(1)

You might be interested in
Select the correct answer. Andy wants to become a multimedia producer. Which degree can help him achieve this goal? A. bachelor’
tatuchka [14]

Answer:

C. bachelor’s degree in filmmaking

Explanation:

Because Andy wants to become a multimedia producer, the degree that would best help him achieve his goal is a bachelor's degree in filmmaking.

Multimedia has to do with both audio, video and graphics or animations because it encompasses multiple media files.

Filmmaking has to do with the various forms of making and producing films. Filmmaking has to do with multiple media (multimedia) and it would help him achieve his goal.

7 0
1 year ago
A good way to avoid skids is to _____ when coming into a turn. A. accelerate B. decelerate C. counter steer D. cover brake
lord [1]

Answer:

B decelerate

Explanation:

Deceleration will help in avoiding you from loosing control of the vehicle

3 0
1 year ago
Read 2 more answers
Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It shou
mario62 [17]

Solution :

class Employee:

   #Define the

   #constructor.

   def __$\text{init}$__($\text{self, nam}e$,  ID_number, $\text{salary}$, email):

       #Set the values of

       #the data members of the class.

       $\text{self.nam}e$ = name

       $\text{self.ID}$_number = ID_number

       $\text{self.salary}$ = salary

       self.email_address = email

#Define the function

#make_employee_dict().

def make_employee_dict(list_names, list_ID, list_salary, list_email):

   #Define the dictionary

   #to store the results.

   employee_dict = {}

   #Store the length

   #of the list.

   list_len = len(list_ID)

   #Run the loop to

   #traverse the list.

   for i in range(list_len):

       #Access the lists to

       #get the required details.

       name = list_names[i]

       id_num = list_ID[i]

       salary = list_salary[i]

       email = list_email[i]

       #Define the employee

       #object and store

       #it in the dictionary.

       employee_dict[id_num] = Employee(name, id_num, salary, email)

   #Return the

   #resultant dictionary.

   return employee_dict

6 0
1 year ago
Locker doors There are n lockers in a hallway, numbered sequentially from 1 to n. Initially, all the locker doors are closed. Yo
kow [346]

Answer:

// here is code in C++

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int n,no_open=0;

   cout<<"enter the number of lockers:";

   // read the number of lockers

   cin>>n;

   // initialize all lockers with 0, 0 for locked and 1 for open

   int lock[n]={};

   // toggle the locks

   // in each pass toggle every ith lock

   // if open close it and vice versa

   for(int i=1;i<=n;i++)

   {

       for(int a=0;a<n;a++)

       {

           if((a+1)%i==0)

           {

               if(lock[a]==0)

               lock[a]=1;

               else if(lock[a]==1)

               lock[a]=0;

           }

       }

   }

   cout<<"After last pass status of all locks:"<<endl;

   // print the status of all locks

   for(int x=0;x<n;x++)

   {

       if(lock[x]==0)

       {

           cout<<"lock "<<x+1<<" is close."<<endl;

       }

       else if(lock[x]==1)

       {

           cout<<"lock "<<x+1<<" is open."<<endl;

           // count the open locks

           no_open++;

       }

   }

   // print the open locks

   cout<<"total open locks are :"<<no_open<<endl;

return 0;

}

Explanation:

First read the number of lockers from user.Create an array of size n, and make all the locks closed.Then run a for loop to toggle locks.In pass i, toggle every ith lock.If lock is open then close it and vice versa.After the last pass print the status of each lock and print count of open locks.

Output:

enter the number of lockers:9

After last pass status of all locks:

lock 1 is open.

lock 2 is close.

lock 3 is close.

lock 4 is open.

lock 5 is close.

lock 6 is close.

lock 7 is close.

lock 8 is close.

lock 9 is open.

total open locks are :3

5 0
1 year ago
Write a python 3 function named words_in_both that takes two strings as parameters and returns a set of only those words that ap
s344n2d4d5 [400]

Answer:

def words_in_both(a, b):

 a1 = set(a.lower().split())

 b1 = set(b.lower().split())

 return a1.intersection(b1)

common_words = words_in_both("She is a jack of all trades", 'Jack was tallest of all')

print(common_words)

Explanation:

Output:

{'all', 'of', 'jack'}

5 0
1 year ago
Read 2 more answers
Other questions:
  • 3. Of the following pieces of information in a document, for which would you most likely insert a mail merge field? A. First nam
    13·2 answers
  • vertical exchanges are typically used only to buy and sell materials required for an organization's support activities ( True or
    14·2 answers
  • You have installed a point-to-point connection using wireless bridges and Omni directional antennas between two buildings. The t
    9·1 answer
  • Which type of word processing programs enables us to include illustrations within the program?
    6·1 answer
  • Write a Python function called simulate_observations. It should take no arguments, and it should return an array of 7 numbers. E
    7·1 answer
  • Mile markers appear as _____ green signs.
    6·2 answers
  • Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem. Print "Unknown" (followe
    13·1 answer
  • Consider the following two code segments, which are both intended to determine the longest of the three strings "pea", "pear", a
    7·1 answer
  • Create a different version of the program that: Takes a 3-digit number and generates a 6-digit number with the 3-digit number re
    14·1 answer
  • Write a function named shout. The function should accept a string argument and display it in uppercase with an exclamation mark
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!