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
Liza works as a receptionist. Around the lunch hour, she has a difficult time hearing the callers due to employees talking near
Rashid [163]
c.<span>barriers to communication
 because the other employees are the ones causing the trouble</span>
6 0
3 years ago
At one college, the tuition for a full-time student is $6,000 per semester. It has been announced that the tuition will increase
Alina [70]

Answer:

  1. var projected_fee = 6000;  
  2. for(var i = 1; i <= 5; i++){
  3.    projected_fee = projected_fee * 0.02 + projected_fee;
  4.    console.log("$" + projected_fee.toFixed(2));
  5. }

Explanation:

Firstly, create a variable, projected_fee, and set the initial tuition fee value to it (Line 1).

Next, user a for loop that run for 5 times to repeatedly calculate the projected_fee based on 2 percent of increment rate (Line 4) and display the projected fee to console terminal (Line 5). The output should be

$6120.00

$6242.40

$6367.25

$6494.59

$6624.48

8 0
3 years ago
What are the six peripherals of a computer system
Lubov Fominskaja [6]
Peripherals fall into three categories:
1. input devices are devices that put commands inside computers such as keyboards, mouses, and joysticks but the first two are the mostly used nowadays
2. output devices are what computers give out such as monitors, printers, speakers and I think projectors also fall into that category
3.storage devices such as a optical drive, hard drive, SDD, flash drive
So the main ones might be a mouse, keyboard, monitors, I think printers, hard drives and flash drives but speakers might be considered as one instead of a flash drive.

4 0
3 years ago
The section of the cpu that is responsible for performing mathematical operations.
nlexa [21]

The CPU executes arithmetic and logic operations in the arithmetic and logic unit (ALU).

<h3>What is an ALU, or an arithmetic and logic unit?</h3>
  • A combinational digital circuit known as an arithmetic logic unit computes arithmetic and bitwise operations on integer binary integers.
  • A floating-point unit, on the other hand, works with floating-point numbers.
  • The component of a central processing unit known as an arithmetic-logic unit performs arithmetic and logic operations on the operands in computer instruction words.
  • An Arithmetic Logic Unit (ALU) is a component found within computers that can execute logical operations in addition to arithmetic operations, such as AND, OR, Ex-OR, invert, etc (e.g. Addition, Subtraction, etc.).

To learn more about arithmetic and logic unit (ALU), refer to:

brainly.com/question/7994884

#SPJ4

4 0
1 year ago
To test dns configuration by resolving a host name to ip address, which command or commands can you use
Helga [31]

ping, tracert or nslookup can all be used.

4 0
3 years ago
Other questions:
  • You can install several printers on your machine, but at least one must be the _______ printer.
    6·1 answer
  • In Python please:
    12·1 answer
  • What do newly PivotTables look like?
    9·1 answer
  • According to the government, employees have a right to understand the risks associated with the materials they work with.
    15·1 answer
  • . Write a toString method for this class. The method should return a string containing the base, height and area of the triangle
    10·1 answer
  • Q: If a program is invoked with "python program.py -r input.dat output.dat", what are the elements of argv?
    10·1 answer
  • a blank search examines the first item to see if it is a match, then the second, and so on. answers: linear, binary, and orderly
    7·2 answers
  • Kelly wants to change the text in a cell so that it is centered instead of left-aligned, where should she look to make this
    8·1 answer
  • Explain the integer and float datatypes with example.<br><br>​
    11·1 answer
  • The first time that a particular visitor loads a web site page is called a(n) _____.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!