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 of the following is an example of a logic error?
rusak2 [61]

Answer:

Receiving unexpected results from a program

Explanation:

Logic errors are due to the program not producing a desired result.

6 0
3 years ago
Read 2 more answers
________ is an encryption standard used for secure transactions such as credit card processing and online banking. TLS DMZ White
Fynjy0 [20]

Answer:

TLS

Explanation:

In the field of computer security, TLS refers to Transport Layer Security it is closely related to the Secure Sockets Layer (SSL) although TLS is more commonly used these days. They are both techniques in cryptography that provides for the safe transfer of information between two parties (servers, systems and user applications)

TLS particularly provides a balance between transmission speed and data security through the use of symetric and asymmetric cryptography and the encryption and decryption key is the session key at both ends (sender and reciever), as such TLS has found usage in most advanced data exchange systems like credit card processing and online banking.

8 0
3 years ago
This organization created web standards to be followed in the creation and contentof a web page​
kumpel [21]

Answer:

The World Wide Web Consortium (W3C) is an international community where member organizations, a full-time staff, invited experts and the public work together to develop Web Standards. Led by Web inventor and Director Tim Berners-Lee and CEO Jeffrey Jaffe, W3C's mission is to lead the Web to its full potential.

<em />

<em>Hope you got it</em>

4 0
2 years ago
Suppose there are two ISPs providing WiFi service in a café. Each ISP operates its own AP and has its own IP address block. If b
Alinara [238K]

Answer:

As a design rule, access points within range of each other should be set to channel frequencies with minimal signal overlap. Users will find that roaming doesn’t work well, and performance will degrade because of interference between access points.

Explanation:

8 0
3 years ago
The ______ manages the hardware components including the cpu, memory storage, and peripheral devices. options operating system d
Alexandra [31]
The answer is the os or operating system
8 0
2 years ago
Other questions:
  • What is one concern associated with web-based applications?
    12·1 answer
  • A light or optical microscope most commonly used is called a(n) _____. bright-field microscope dark-field microscope electron mi
    8·2 answers
  • NEED THIS NOW PLEASE!!!! (I AM NOT JOKING I HAVE TO SUBMIT IN 5 MINUTES)
    13·2 answers
  • What does it mean by MYRIAD of data?
    9·1 answer
  • Once secured a wheelchair may move up to 6 inches in any direction
    6·1 answer
  • What is true about super computers?
    15·1 answer
  • Which one is exit controllefd loop ?<br>1.while loop <br>2. for loop<br>3. do loop<br>4. none <br>​
    11·1 answer
  • What is the effect of flattening layers in image editing?
    14·2 answers
  • Who's hype for Halo Infinite?
    11·2 answers
  • Consider the following code.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!