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
What are the uses of navigation keys​
Zolol [24]
The navigation keys allow you to move the cursor, move around in documents and webpages, and edit text.
3 0
2 years ago
6.Which of the following statements illustrates a characteristic of a person's attitudes
OleMash [197]
They act like a filter for info a person receives
8 0
3 years ago
Read 2 more answers
Write a for loop to print all num_vals elements of array hourlytemp. separate elements with a comma and space. ex: if hourlytemp
HACTEHA [7]
<span>import java.util.Scanner; public class PrintWithComma { public static void main (String [] args) { final int NUM_VALS = 4; int[] hourlyTemp = new int[NUM_VALS]; int i = 0; hourlyTemp[0] = 90; hourlyTemp[1] = 92; hourlyTemp[2] = 94; hourlyTemp[3] = 95; /* Answer */ System.out.println(""); return; } }</span>
3 0
3 years ago
What is the Internet?
34kurt

"A collection of computers that are linked together" is the Internet.

<u>Answer:</u> Option C

<u>Explanation:</u>

To connect to the Internet and other computer systems on the networks, a network interface cards (NIC) must be installed on the computer. A network cable connected to one end of the NIC and connected to a cable modem, DSL modems, switch or router can allow your computer to connect to the Internet and connect to other computers.

In the rest of all other networks, computers with Windows or Mac have easy access to an internet connectivity. You can even turn your computer into a wireless access points so you don't need a router to pair wireless devices.

7 0
3 years ago
Frankie is considering whether to use a binary or linear search in her program to find a value in a sorted list. When she tests
muminat

Answer:

binary search will still be faster

Explanation:

Based on this scenario, the most likely result is that the binary search will still be faster. This is because Binary search repeatedly cuts the list in half thus shortening the search times drastically. This being said, the longer lists will still take more than 10 times as long than the shorter lists because there is a far greater list of combinations for the search algorithm's to sort through.

4 0
3 years ago
Other questions:
  • Which of the following is LEAST needed when programming a computer?
    7·1 answer
  • The this reference . a) can be used implicitly b) must be used implicitly c) must not be used implicitly d) must not be used 25)
    11·1 answer
  • What must be true before a motherboard can take advantage of the triple memory channels on the board?
    9·1 answer
  • Convert 78 to binary
    6·2 answers
  • What is the Matlab command to create a column vector with 11 equally spaced elements, whose first element is 2 and whose last is
    8·1 answer
  • The steps.txt file contains the number of steps a person has taken each day for a year. There are 365 lines in the file, and eac
    12·1 answer
  • Does anybody know how to get this little search bar thing off of my task bar on a HP laptop.
    12·1 answer
  • How will I go about conducting the investigation on fake news
    10·1 answer
  • Your friend decides to create a spreadsheet containing vocabulary terms and their definitions to help prepare for the unit test
    5·1 answer
  • Write a program to demonstrate circular linked list with operations using pointers – insert
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!