1answer.
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
SashulF [63]
3 years ago
6

Write down the pseudo code for a brute-force algorithm to compare elements in array A with elements in array B.

Computers and Technology
1 answer:
Thepotemich [5.8K]3 years ago
5 0

Answer:

def brute_force(array1, array2):

   for item in array1:

       for element in array 2:

           if element == item:

               print(f"{element} and {item} are a match")

Explanation:

A brute-force algorithm is a direct-to-solution algorithm that searches and compares variables. It is like trying to unlock a safe but not knowing its four-digit combination, brute-force starts from 0000 through 9999 to get a match.

The python program implements the algorithm using two nested for loops. The first loop iterates over array1 while the second, over array2. For every item in the first array, the program loops through the length of the second array. For every match, the items are printed on the screen.

You might be interested in
Although saying "Cylinder IS A Circle" doesn't make sense, it can be implemented in Java using inheritance in a legitimate way.
allochka39001 [22]

Answer:

I've included in the codes the area to circle and volume to cylinder. The Volume method that was used, area() to compute, the volume of cylinder which shows that cylinder is an expansion of circle with an extra dimension (height)

Explanation:

Temp is tester class

public class Temp {

   public static void main(String[] args) {

       Circle c = new Circle(7);

       System.out.println("Area of circle with radius 7 is "+c.area());

       Cylinder c1 = new Cylinder(7,10);

       System.out.println("Cylinder volume with radius 7 and height 10: "+c1.volume());

   }

}

----------------------------------------------------------------------------------------------------

class Circle{

   int radius;

   Circle(int r){

       radius=r;

   }

   double area(){  //area of circle

       return 3.14*radius*radius;

   }

   public int getRadius() {

       return radius;

   }

   public void setRadius(int radius) {

       this.radius = radius;

   }

}

class Cylinder extends Circle{

   int height;

   Cylinder(int r, int h){

       super(r);

       height=h;

   }

   double volume(){  //volume of cylinder

       return area()*height;

   }

   public int getHeight() {  //accessor

       return height;

   }

   public void setHeight(int height) {  //mutator

       this.height = height;

   }

}

8 0
4 years ago
An OS X backup utility that automatically backs up files to a dedicated drive that is always available when the computer is turn
Darya [45]

Answer:

Time machine.

Explanation:

An OS X backup utility that automatically backs up files to a dedicated drive that is always available when the computer is turned on is called a time machine.

OS X was released in 2001 and it's Apple's version ten (10) of the operating system that runs on its Macintosh computers.

A time machine is a software tool built into the Mac operating system and it is primarily designed to automatically backup user files or data onto a dedicated drive such as an external hard drive disk through a wired connection, by using a Thunderbolt or universal serial bus (USB) cable. The automatic backup can as well be done wirelessly through a network connection.

5 0
3 years ago
Which search strategy explores nodes from the initial state as well as the goal state?
Simora [160]
Pretty sure it’s c! I’m not 100% tho sorry if I’m wrong have a nice day:)
5 0
3 years ago
Read 2 more answers
If you have a long title for a table and need it to span several cells you use
dsp73
If you are talking about on Microsoft Excel then you merge the cells.
6 0
3 years ago
How do you make a ringtone on earsketch
RoseWind [281]

Haven't used earsketch, but here we go.

Answer:

1). Make a track in earsketch, make it like 6/7 seconds

2.) export your track as an .mp3, .wav, or  .ogg (your choice!)

3.) (If on android) Navigate to settings, now search for an entry for ringtone.

4.) If you have no luck, look up how to set ringtone on your desired phone brand (iOS, Android, etc.)

5.) Test out your new ringtone

6.)Profit

4 0
3 years ago
Other questions:
  • When you use file explorer or windows explorer to delete a file from the hard drive, where does windows put the file?
    11·1 answer
  • I need this ASAP anyone pleas help me i have to do this by tonight
    10·1 answer
  • The local emergency manager has the responsibility for coordinating emergency management programs and activities. A local emerge
    7·1 answer
  • A DBMS makes the: a. relational database available for different analytical views. b. physical database available for different
    12·1 answer
  • The _______ command was developed by nicholas harbour of the defense computer forensics laboratory.
    12·1 answer
  • The four general functions of any application program are: data storage, data access logic, application logic and presentation l
    11·1 answer
  • Hey anyone wanna zoom.
    7·2 answers
  • Which is the purpose of adding B-Roll footage to a sequence?
    10·1 answer
  • Which of the following is document content that displays at the top of every page?
    11·1 answer
  • ……………………is one of the most popular cloud storage facilities.​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!