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

1. Given a sequential list with n numbers, represented in a one-dimensional array A) Write an algorithm to check if the list has

any duplication. Explain the time complexity of your algorithm. Can you think of a better algorithm to do the job? If so, briefly explain. B) Write an algorithm to find all the duplicate numbers in the list, if any. Explain the time complexity of your algorithm. Can you think of a better algorithm to do the job? If so, briefly explain.
Computers and Technology
1 answer:
lutik1710 [3]3 years ago
8 0

Answer:

Define a function that accept a list as an argument. Save the length of the list as a variable and cast the list to a set and also save the length to a variable.

If the result of the subtraction of the set length from the list length is not equal to zero, then the list have duplicates.

Explanation:

A sample of the source code using Python,

def list_duplicate( list ):

list_len = len( list )

new_set = set( list )

set_len = len( new_set )

If list_len - set_len != 0 :

Print( " The list has duplicate " )

You might be interested in
How do you think computers have helped to improve documentation, support and services within the healthcare industry.
AfilCa [17]
Before the use of technology such as computers, information was documented through papers separated in folders. This was a very long and complicated process as people would have to find information by hand, sorting through countless documents. Now, it is much easier and neater to keep information. It can be as easy as digitally searching for someone's name and the computer will sort through countless documents, finding the one you need almost instantly. It is also much less wasteful and safe, as before computers, the use of paper was the only way to permanently keep information, also making documents vulnerable to being lost or stolen.
4 0
3 years ago
At regular intervals the AP in an infrastructure network or wireless device in an ad hoc network sends a ____ frame both to anno
pshichka [43]

Answer:

beacon

Explanation:

At regular intervals the AP in an infrastructure network or wireless device in an adhoc network sends a beacon frame both to announce its presence and to provide the necessary information for other devices to join the network.

5 0
3 years ago
If you want to stop a loop before it goes through all of its iterations, the break statement may be used. Group of answer choice
NeX [460]

Answer:

Answer is true

Explanation:

6 0
1 year ago
Which technology do online storesusually use to present customized content?
k0ka [10]

Answer:

real time analytics technology

Explanation:

Online stores usually use real-time analytics technology to present customized content. Explanation: Real-time analytics is gaining popularity nowadays. It is basically the procedure of measuring and preparing the data as it enters the database

8 0
2 years ago
Ses
jekas [21]

Answer:

Amoung us

Explanation:

When the imposter is sus

8 0
3 years ago
Other questions:
  • Once you resize a photograph, it cannot be returned to its original size. TRUE or FALSE
    8·1 answer
  • Why is outfitting a workspace with video games in technology development company considered a strategic use of money
    8·2 answers
  • Describe the best way to deal with a difficult co-worker?
    13·2 answers
  • What is it called to persist in trying to multitask can result in this; the scattering bits of one’s attention among a number of
    9·1 answer
  • The method needed to arrange for an object to be notified when a window's close-window button has been clicked is
    6·1 answer
  • Which type of element is , and what is the meaning of that element?
    8·1 answer
  • Examples of application software​
    7·2 answers
  • 6. Python indexes lists beginning with the number 1.<br> True<br><br> False
    15·1 answer
  • Explain how you can apply the computer in your field of study​
    6·1 answer
  • Using computers can lead to a number of physical safety issues. State and explain TWO(2) of these types of issues.​​​​​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!