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
Ivanshal [37]
4 years ago
10

g Given an array, the task is to design an efficient algorithm to tell whether the array has a majority element, and, if so, to

find that element. The elements of the array are not necessarily from some ordered domain like the integers, and so there can be no comparisons of the form "is A[i] ≥ A[j]?". (Think of the array elements as GIF files, say.) However you can answer questions of the form: "is A[i] = A[j]?" in constant time
Computers and Technology
1 answer:
AnnZ [28]4 years ago
4 0

Answer:

If there is a majority element in the array it will be the median. Thus,

just run the linear time median finding algorithm, and compare the result with all the  elements of the array (also linear time). If \frac{n}{2}elements are the same as the median, the  median is a ma majority element. If not, there is none.

Suppose now that the elements of the array are not from some ordered domain like the  integers, and so there can be no comparisons of the form "is the ith element of the array  greater than the jth element of the array?" However you can answer questions of the  form:

"Are the ith and jth elements of the array the same?" in constant time. Such

queries constitute the only way whereby you can access the array. (Think of the elements  of the array as GIF files, say.) Notice that your solution above cannot be used now.

You might be interested in
What task do the referential integrity settings prevent?
Cerrena [4.2K]

Answer:

D

Explanation:

5 0
3 years ago
Read 2 more answers
Which of these definitions BEST explains what plagiarism is:
Alex777 [14]
To use another person's work without crediting the source.
6 0
3 years ago
Read 2 more answers
Advantage of realtime processing​
Ray Of Light [21]

Answer:

Advantages of Real-time Software. Maximum system consumption is achieved from real-time software because it produces more output by using all resources while keeping all devices active. There is no or little downtime in such systems. It can be used by hosted servers to get maximum results from hosting companies.

Explanation:

8 0
3 years ago
Someone want to do a project for me, I will give 1000 points to you if you do it
spayn [35]
It depends on what it is.
4 0
3 years ago
What is responsible for coordinating a computer's hardware and software components?
Yuri [45]
Control unit is responsible for coordinating a computers hardware and software components.
control unit is circuitry that directs operations within a computers processor. It  works by receiving input information that it converts into control signals,which are then sent to the central processor.The computers processor then tells the attached hardware what operations to carry out.

8 0
4 years ago
Other questions:
  • What is the purpose of lookup tables in spreadsheet software
    13·2 answers
  • How to do this? ICT Excel there's a screenshot attached
    6·1 answer
  • Can u suggest me some Hindi movies that is on you-tube please suggest
    7·2 answers
  • What is constructive criticism?
    9·1 answer
  • A file to which information is written is referred to as a(n) ____ file.
    8·1 answer
  • BOTH INTERNATIONAL & INLAND Which procedure(s) shall be used to determine risk of collision?
    14·1 answer
  • Do you watch markiplier?
    13·2 answers
  • Pls help ...
    13·1 answer
  • If you hard working right now go to this EASY question
    9·2 answers
  • Q3: What do you mean by a pointer to a pointer? Can this be extended?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!