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
Lesson 12: while loops with the farmer. Number 9.
Vikki [24]

Answer:

just repeat the move forward as many times until you get to the hole and fill 1

Explanation:

i think this might work

if it does can i have brainliest

3 0
3 years ago
Read 2 more answers
What is and effective way to display calculation in a word document?
Tju [1.3M]
You only put a numerical expression in  numbers if it is over 100, it the calculation correctly.
<span />
8 0
4 years ago
Software (often on firmware) designed to make physical products and devices smarter by doing things like sharing usage informati
saveliy_v [14]

Answer:

Embedded Systems.

Explanation:

Software (often on firmware) designed to make physical products and devices smarter by doing things like sharing usage information, helping diagnose problems, indicating maintenance schedules, providing alerts, or enabling devices to take orders from other systems is referred to as Embedded Systems.

6 0
3 years ago
Respond to Social EngineeringYou work as the IT security administrator for a small corporate network. The company president has
Cloud [144]

Answer:

Delete any emails that are attempts at social engineering

Explanation:

The actual URL of an email could tell if an hazardous, an unwanted or an unexpected email is being received, hence one can be sure of social engineering through this means. Hence, this could provide a solution to this problem.

4 0
4 years ago
Skunkworks appeared to have ________ task interdependence, while the Levittown builder seemed to have ________ task interdepende
aliina [53]

The article upon which the question is based on:

The Skunk Works home page describes this team best: "What do the world’s first stealth aircraft, the world’s most advanced fighters, and the world’s fastest manned aircraft have in common? They were all imagined by ‘Skunks’—some of the most innovative, strategic, and visionary thinkers around." Kelly Johnson was permitted to build an experimental engineering department in 1943, and the rest is history. The small-staffed unit was organized by integrating designers with builders, working together so that ideas were buildable, with limited visitors allowed from the outside. The impressive results are many, including the U-2, the world’s first spy plane, and the SR-71 Blackbird, the world’s fastest, highest-flying aircraft.

Answer:

1. comprehensive

2. sequential

Explanation:

Skunkworks appeared to have COMPREHENSIVE task interdependence, while the Levittown builder seemed to have SEQUENTIAL task interdependence.

This is based on the idea that Skunkworks acknowledges the powers of interaction and coordination of team members and while Levittown builders work on gradual working arrangement as one input of part A becomes the input of part B, and it goes on.

6 0
3 years ago
Other questions:
  • Which javascript method should you use if you want to specify a message string to appear on your web page as it loads?
    13·1 answer
  • What is Mainframe computer​
    14·1 answer
  • Key physical database design decisions typically do not include: A) choosing the storage format for each attribute from the logi
    12·1 answer
  • Dynamic addressing: __________.
    12·2 answers
  • Take a minute to reflect on your thoughts and learning so far and discuss:
    13·1 answer
  • Win10如何删除自己添加的环境变量?...............
    8·1 answer
  • Which three statements are true of lossless compression?
    6·1 answer
  • Who likes my meme? :)
    9·2 answers
  • Can someone please help? i am trying to code my raspberry pi pico in python, and it says this is wrong. Can someone help tell me
    6·1 answer
  • Explain how information in an access log could be used to identify the true identity of an impostor who has acquired unauthorize
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!