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
astraxan [27]
3 years ago
10

Assume you have a sorting algorithm that you can use as a black box. Use the sorting algorithm to sort the input list. Now write

an algorithm to count the number of duplicates again. Analyze the time complexity of your algorithm in the worst-case (ignore the time complexity of sorting). Could you improve the worst-case time complexity of your algorithm compared to the previous question
Computers and Technology
1 answer:
Ber [7]3 years ago
7 0

Answer:

Algorithm explained below

Explanation:

Algorithm to check duplicate when list of element is sorted:

CheckDuplicate( Sorted list )

    initialize count = 0

    Repeat untill we reach on end of list :

            if next is not end of list and current element is equal to next element

                    count = count+1

                    increase the pointer to next untill a different element is found

end CheckDuplicate

Worst Case Time Complexity will be O(n). Because there is only one iteration over the list will be performed.

Yes We have improved the worst case time complexity compared to previous question.

Actually after applying sorting all the similar element to will be next to each other.Then we will start iterating one by one from one side and check which is similar to next.If a different element will be find then we will check whether it's next is similar to it or not.

eg. 1 1 1 2 2 2 4 4 4 we can check duplicate in one iteration.

You might be interested in
Which are characteristics of pseudocode? Select all that apply.
jeka94

Answer:

A,B,C

Explanation:

3 0
3 years ago
Why is it now difficult for computer technology to maintain the pace of
KatRina [158]

It now difficult for computer technology as manufacturing cannot keep up with overwhelming transistor demand.

<h3>What was Moore's Law ?</h3>

Moore's Law is the one that talks about the fact that the number of transistors on a microchip is one that often goes up about two years always, even if the cost of computers is reduced.

Based on the above, It now difficult for computer technology as manufacturing cannot keep up with overwhelming transistor demand.

Learn more about computer technology  from

brainly.com/question/24912812

#SPJ1

6 0
2 years ago
How many answers do you need to be able to write messages on here??
Kipish [7]

1,000

Hope this helps!



~Courtney

3 0
2 years ago
¿por que la toria de lamarck sobre el alargamiento del cuello de las jirafas por el esfuerzo continuado no pasara a sus descendi
Paha777 [63]

Respuesta: Los caracteres adquiridos no se transmiten genéticamente porque no modifican el ADN de los organismos

Explicación:

Jean-Baptiste Lamarck al igual que Charles Darwin, propuso una teoría sobre la evolución que explicaba cambios en los organismos a través del tiempo. La teoría de Lamarck se enfocaba en condiciones en el ambiente que propiciaban cambios en los organismos. Un ejemplo de esto son las jirafas, que de acurdo a Lamarck tenían cuellos largos debido al esfuerzo continuado para comer hojas de árboles altos. Esto significa que la característica de cuello largo era adquirido por las jirafas durante su vida y según Lamarck se transmitiría a sus descendientes.

Sin embargo, se ha comprobado que los caracteres adquiridos no modifican el ADN de los organismos, por ejemplo las cirugías estéticas no cambian el ADN de una persona y por esta razón no son transmitidos a sus descendientes. Por el contrario, en las poblaciones de organismos ciertas características prevalencen en el tiempo debido a la selección natural. Esto significa que el cuello de las jirafas es el resultado que el cuello largo sea una característica beneficiosa que ha prevalecido debido a la selección natural y no de características adquiridas que son transmitidas a descendientes.

7 0
3 years ago
Jana works in a call center helping people who are having trouble setting up their
olchik [2.2K]

Answer:

Information Support and Services

Explanation:

She works helping people setting up their accounts so she supports with information from her services

4 0
2 years ago
Read 2 more answers
Other questions:
  • A server-side extension ________________. provides its services to the web server in a way that is totally transparent to the cl
    13·1 answer
  • What is the internet?
    5·2 answers
  • The Chart below from Google Trends shows the prevelance of some search terms in the United States between 2004 and the present.
    8·1 answer
  • Explain SATA peripheral bus operation?
    14·1 answer
  • Write a program that asks the user for three strings. Then, print out whether the first string concatenated to the second string
    8·1 answer
  • What is an online recommendation engine?
    12·1 answer
  • How to buy free big money computers that earn free money everydays?
    15·1 answer
  • Which of the following lines of code is syntactically correct?
    14·1 answer
  • when inserting a bibliography one choose from multiple ______ of bibliographies.[insert Bibliography]
    12·1 answer
  • To speed up data retrieval, more vehicles will be upgraded to cellular connections and be able to transmit data to the ETL proce
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!