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
Musya8 [376]
3 years ago
14

You are a visitor at a political convention with delegates; each delegate is a member of exactly one political party. It is impo

ssible to tell which political party any delegate belongs to; in particular, you will be summarily ejected from the convention if you ask. However, you can determine whether any pair of delegates belong to the same party or not simply by introducing them to each other. Members of the same party always greet each other with smiles and friendly handshakes; members of different parties always greet each other with angry stares and insults.
Required:
Suppose more than half of the delegates belong to the same political party. Design a divide and conquer algorithm that identifies all member of this majority party and analyze the running time of your algorithm.
Computers and Technology
1 answer:
Fed [463]3 years ago
5 0

Answer:

The algorithm is as follows:

Step 1: Start

Step 2: Parties = [All delegates in the party]

Step 3: Lent = Count(Parties)

Step 4: Individual = 0

Step 5: Index = 1

Step 6: For I in Lent:

Step 6.1: If Parties[Individual] == Parties[I]:

Step 6.1.1: Index = Index + 1

Step 6.2: Else:

Step 6.2.1 If Index == 0:

Step 6.2.2: Individual = I

Step 6.2.3: Index = 1

Step 7: Else

Step 7.1: Index = Index - 1

Step 8: Print(Party[Individual])

Step 9: Stop

Explanation:

The algorithm begins here

Step 1: Start

This gets the political parties as a list

Step 2: Parties = [All delegates in the party]

This counts the number of delegates i.e. the length of the list

Step 3: Lent = Count(Parties)

This initializes the first individual you come in contact with, to delegate 0 [list index begins from 0]

Step 4: Individual = 0

The next person on the list is set to index 1

Step 5: Index = 1

This begins an iteration

Step 6: For I in Lent:

If Parties[Individual] greets, shakes or smile to Party[i]

Step 6.1: If Parties[Individual] == Parties[I]:

Then they belong to the same party. Increment count by 1

Step 6.1.1: Index = Index + 1

If otherwise

Step 6.2: Else:

This checks if the first person is still in check

Step 6.2.1 If Index == 0:

If yes, the iteration is shifted up

Step 6.2.2: Individual = I

Step 6.2.3: Index = 1

If the first person is not being checked

Step 7: Else

The index is reduced by 1

Step 7.1: Index = Index - 1

This prints the highest occurrence party

Step 8: Print(Party[Individual])

This ends the algorithm

Step 9: Stop

The algorithm, implemented in Python is added as an attachment

<em>Because there is an iteration which performs repetitive operation, the algorithm running time is: O(n) </em>

Download txt
You might be interested in
Wider channel bandwidth ________. increases transmission speed allows more channels to be used in a service band both increases
sattari [20]

Wider channel bandwidth decreases transmission speed.

<h3>What is Wider channel bandwidth?</h3>

Wider WiFi channel widths is known to be a bandwidth that is made up  of 40 MHz and 80 MHz width.

They are known to be used often in the 5 GHz frequency band. In this type pf band, there are said to have a lot of WiFi channels and also less overlapping channels and as such, Wider channel bandwidth decreases transmission speed.

Learn more about bandwidth  from

brainly.com/question/4294318

7 0
2 years ago
In this technique, each attribute is associated with a specific feature of a face, and the attribute value is used to determinet
s344n2d4d5 [400]

Answer:

Chernoff faces.

Explanation:

Chernoff faces is a data visualization technique that was developed by a statistician named Herman Chernoff. He introduced this data visualization technique to the world in 1973 to represent multivariate or multidimensional data containing at least eighteen (18) variables.

In Chernoff faces, each attribute is associated with a specific feature of a face (nose, eyes, ears, hair, mouth, and eyebrows), and the attribute value with respect to size, shape, orientation, colour and placement is used to determine the way a facial feature is expressed.

The Chernoff face is a technique designed and developed to help detect similarities between different items and discern subtle changes in facial expressions from the perspective of an observer.

6 0
3 years ago
What are some consequences of internet addiction​
fenix001 [56]

Answer:

<em>1</em><em>. </em><em>week</em><em> </em><em>eyesight</em>

<em>2</em><em>. </em><em> </em><em>weak</em><em> </em><em>brain</em><em> </em><em>power</em>

<em>3</em><em>. </em><em>loss</em><em> </em><em>of</em><em> </em><em>concentra</em><em>tion</em><em>.</em><em>.</em><em>.</em>

<em>hope</em><em> </em><em>it</em><em> </em><em>helps</em><em> </em><em>u</em>

4 0
3 years ago
An organization's IRP prioritizes containment over eradication. An incident has been discovered where an attacker outside of the
djyliett [7]

Answer:

a. Remove the affected servers from the network.

Explanation:

An organization's incident response process (IRP) can be defined as all of the process involved in the cleanup and recovery of data when they fall victim to an attack or cybersecurity breach. The incident response process comprises of six (6) important stages and these are;

1. Preparation.

2. Detection and analysis (identification).

3. Containment.

4. Eradication.

5. Recovery.

6. Review of incident activities.

When an organization's IRP prioritizes containment over eradication and an incident is discovered, where an attacker outside the organization installed a crypto-currency mining software on the organization's web servers. Given the organization's stated priorities, the cybersecurity engineer should remove the affected servers from the network.

A containment process is focused on taking steps to eliminate or contain the attack. It basically involves acting swiftly in response to the attack, so as to prevent it from spreading across board or in order to mitigate the damage already caused.

In this context, the cybersecurity engineer should remove the affected servers from the network in accordance with the organization's IRP priority (containment).

<em>Furthermore, he could take a step further to contain the attack by installing a firewall and updating their policies in the Intrusion Prevention System (IPS) of the organization. </em>

5 0
3 years ago
A conventional uniprocessor has __________ .
lys-0071 [83]

Answer:

The correct option to the following question is option (A).

Explanation:

SISD is used in the uni-processors systems which executes an individual instruction streams at a time by which we control an individual memory for the storage of data.

It is the flow or the sequence of an individual data or instructions which controlled on the systems.

Whereas SISD is different from the SMID and it is not used in the Uni-processor systems

3 0
3 years ago
Other questions:
  • You can choose which rules you want excel to use by enabling and disabling them in the ____ area in the excel options dialog box
    11·1 answer
  • What does pagination mean in Microsoft Word?
    10·2 answers
  • HELP
    13·1 answer
  • What are ways to enter formula in Excel? Check all that apply
    8·2 answers
  • Mila received a new DVD player that she is trying to connect to the back of her television by feel alone. The first stage of mem
    11·1 answer
  • What does it mean to say that a graph is complete?
    14·1 answer
  • What causes the poles of the electromagnet in an audio speaker to repeatedly switch directions?
    6·2 answers
  • List the caveats to this analysis and how they affect the research. How does this document define the ""typical game developer""
    7·2 answers
  • What will be the output of following python code? a,b=3,4 a,b,c=b,a+3,b-1 print(a,b,c)​
    7·1 answer
  • Name 6 examples of how telemedicine is used in healthcare
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!