Describe an algorithm that takes as input a list of n integers in nondecreasing order and produces the list of all values that occur more than once. (

Answers

Answer 1

Answer:

Input a series of integer numbers and split the string from the input to get a list. Then check and convert each string to integer with a list comprehension. Create a new variable with a value equal to the set of the list ( to get unique values) then check for the occurrence of each value in the original list.

Explanation:

This algorithm is used to check for the occurrence of values in a list that has been sorted in ascending order. This is faster if the items in the list is not converted to integer yet (still strings) before writing a for loop to check the value count in the list.


Related Questions

Write a function named power that accepts two parameters containing integer values (x and n, in that order) and recursively calculates and returns the value of x to the nth power.

Answers

Answer:

Following are the code to the given question:

int power(int x, int n)//defining a method power that accepts two integer parameters

{

if (n == 0)//defining if block to check n equal to 0

{

return 1; //return value 1

}

else//defining else block

{

x = x * power(x, --n); //use x variable to call method recursively

}

return x; //return x value

}

Explanation:

In the above-given code, a method power is defined that accepts two integer variable in its parameter, in the method a conditional statement is used which can be defined as follows:

In the if block, it checks "n" value, which is equal to 0. if the condition is true it will return value 1.In the else block, an integer variable x is defined that calls the method recursively and return x value.

The router can deliver packets directly over interfaces 0 and 1 or it can forward packets to Routers R2, R3, or R4. Describe what the router does with a packet addressed to each of the following destinations:

a. 128.96.39.10
b. 128.96.40.12
c. 128.96.40.151
d. 192.4.153.17
e. 192.4.153.90

Answers

Answer:

Following are the solution to this question:

Explanation:

In point A:

It applies the AND operation with the subnet-mask that is  

[tex]=128.96.39.00001010 \ \ AND \ \ 255.255.255.10000000 \\\\= 128.96.39.0000000 \\\\= 128.96.39.0 \\\[/tex]

This corresponds to a 128.96.39.0 subnet. This is why the router sent the packet to 0.

In point B:  

It applies the AND operation with the subnet-mask that is [tex]255.255.255.128[/tex]

[tex]= 128.96.40.00001100\ AND \ 255.255.255.10000000 \\\\ = 128.96.40.0000000\\\\= 128.96.40.0[/tex]

This suits the 128.96.40.0 subnet. The router then sent R2 to the packet. The packet.

In point C:  

It  applies the AND operation with the subnet-mask that is [tex]255.255.255.128[/tex]

[tex]=128.96.40.10010111 \ AND \ 255.255.255.10000000 \\\\= 128.96.40.1000000\\\\= 128.96.40.128[/tex]

It  applies the AND operation with the subnet-mask  that is [tex]255.255.255.192[/tex]

[tex]= 128.96.40.10010111 \ AND \ 255.255.255.11000000 \\\\= 128.96.40.1000000 \\\\= 128.96.40.128\\[/tex]

All of the matches of its sublinks above.  

Its default R4 router was therefore sent to the router by router.

In point D:

It  applies the AND operation with the subnet-mask  that is [tex]255.255.255.192[/tex]

[tex]= 192.4.153.00010001 \ AND \ 255.255.255.11000000\\\\ = 192.4.153.0000000 \\\\= 192.4.153.0 \\\\[/tex]

It matches the 192.4.153.0 subnet. It router has sent packet to R3 then.

In point E:

It  applies the AND operation with the subnet-mask  that is [tex]255.255.255.128[/tex]

[tex]= 192.4.153.01011010\ AND \ 255.255.255.10000000 \\\\= 192.4.153.0000000 \\\\= 192.4.153.0[/tex]

There, neither of the subnet inputs correlate with the ip address with the same subnet mask.

It  applies the AND operation with the subnet-mask  that is [tex]255.255.255.192[/tex]

[tex]=192.4.153.01011010\ AND \ 255.255.255.11000000 \\\\ = 192.4.153.0100000 \\\\= 192.4.153.64[/tex]

It does not correlate to the subnet entries for same subnet mask, and therefore neither of the entries matches their corresponding ip address entries.  

Mask of the subnet.  That packet would therefore be sent to the default R4 router by the router.

what is the art of prolonging the life of the food items that are available​

Answers

Answer:

Food preservation.

Explanation:

Food preservation can be defined as an art that typically deals with the process of preventing food spoilage by reducing or mitigating the growth of microorganisms and other external factors while maintaining the nutritional value, flavor and texture of the food.

Some of the factors that causes food spoilage include microorganisms (bacteria, yeast and molds), temperature, moisture content, oxidation etc.

Hence, food preservation is the art of prolonging the life of the food items that are available.

Basically, there are physical, chemical and biological methods which can be used to prolong the life of food items and thus sustaining the edibility and nutritional value of foods. These methods are;

1. Freezing.

2. Pasteurization.

3. Drying.

4. Retorting.

5. Thermal sterilization.

6. Fermentation.

7. Irradiation.

HELP !!!
Which of the following statements best represents the difference in printing text and images in the era of moveable type?


Text was harder to print than images because it involved moving letters around for each line of print.

Text was created by arranging letter blocks, while images were created through an engraving process.

Text was created by engraving letter blocks on metal, while images were created by burning imprints onto wood.

Text was easier to print than images because it involved the same 26 letters used over and over.

Answers

Answer:

I think the answer is: Text was created by arranging letter blocks, while images were created through an engraving process.

Explanation:

in the article it explains these were the ways text and images were printed

Answer:

e

Explanation:

how many total bits do you need to represent 512?

Answers

Answer:

9 bits

Explanation:

hope it helps......

Answer:

9 bits

hope it helps...

server.
10. The Domain Name refers to the
a) Mail
b) Google
c) Internet
d) Local

Answers

Answer:

C.

Explanation:

what do we use HTTP and HTML for?

Answers

HTTP is protocol while HTML is a language

HTML is a Language while HTTP is a Protocol.

HTML tags are used to help render web pages. The Hypertext Mark-up Language (or HTML) is the language used to create documents for the World Wide Web.

HTTP (Hypertext Transfer Protocol) is a protocol for transferring the hypertext pages from Web Server to Web Browser. HTTP is a generic and stateless protocol which can be used for other purposes as well using extensions of its request methods, error codes, and headers. Basically, HTTP is a TCP/IP based communication protocol, that is used to deliver data (HTML files, image files, query results, etc.) on the World Wide Web.

The coding system that has just two characters is called:

a
binary
b
dual.
c
basic.
d
double.

Answers

Answer:

A. Binary

Definition:

Pertaining to a number system that has just two unique digits 0 and 1. - binary code

the notes added to slides can be seen during the presentation. TRUE OR FALSE​

Answers

Answer:

It might be true

Explanation:

Because there's something you press, then it will appear, if you didn't press it, it won't appear

I need help with my homework:
Greetings, secret agent 00111! Your mission, should you choose to accept it, is to help Agent M plan a pizza party. Unfortunately, M has no idea how much pizza to order for his 83 guests. Luck for him, party planning is your specialty! Estimate the number of pizzas he’ll need on scratch paper, and then convert that number to binary and write it here.

Answers

Answer:

You need to order 11100 pizzas.

Explanation:

A couple of assumptions here.

Each pizza has 12 slices.  Each guest will eat 4 slices (1/3 of a pizza).

83 * 1/3 = 28 pizzas

28 = 11100

References inserted initially as footnotes can be converted to endnotes through an option in the software.

A. True

B. False

Answers

The answer is A. True

The answer is: A) True

the quality of the interpreter that shows the ability to envision future needs and demands and create products to meet these demands
A. Industries
B. innovative
C. Strategist
D. Risk Taker​

Answers

Answer: B - Innovative

Explanation:

I need help plz it’s python

Answers

Answer:

The output of the first question would be 9. And the answer the second question is 10.

Where should a range name be entered? in the Home tab on the ribbon in the title box in the status bar in the title bar in the name box in the formula bar

Answers

Answer:

in the name box in the formula bar

Explanation:

edg 2020!!

Answer:

D.

Explanation:

edg 2020

Q Basic program write a program in Q Basic to find the cost of 10 pens when the cost of 15 pens is 75 use unitary method to find calculate the cost of one pen calculate the print of cost of 10 pen computer answer​

Answers

give the function of cpu

Building-block elements are available in the Building Blocks grouping include which of the following? Page Parts Calendars Advertisements Business Information

Answers

Answer: Page parts , calendar and advertisements

Explanation:

(I jus Finish the assignment)

Which keyboard command would you use to navigate to the left adjacent cell in a worksheet?

Answers

Answer:

Either scroll on a mouse or use the left arrow key.

I don't know if this is right.

Answer:

shift+tab

Explanation:

Write a function named minMax() that accepts three integers arguments from the keyboard and finds the smallest and largest integers. Include the function minMax() in a working program. Make sure your function is called from main().Test the function by passing various combinations of three integers to it.

Answers

Answer:

public class Main

{

public static void main(String[] args) {

 minMax(1, 2, 3);

 minMax(100, 25, 33);

 minMax(11, 222, 37);

}

public static void minMax(int n1, int n2, int n3){

    int max, min;

    if(n1 >= n2 && n1 >= n3){

        max = n1;

    }

    else if(n2 >= n1 && n2 >= n3){

        max = n2;

    }

    else{

        max = n3;

    }

   

    if(n1 <= n2 && n1 <= n3){

        min = n1;

    }

    else if(n2 <= n1 && n2 <= n3){

        min = n2;

    }

    else{

        min = n3;

    }

    System.out.println("The max is " + max + "\nThe min is " + min);    

}

}

Explanation:

*The code is in Java.

Create a function named minMax() that takes three integers, n1, n2 and n3

Inside the function:

Declare the min and max

Check if n1 is greater than or equal to n2 and n3. If it is set it as max. If not, check if n2 is greater than or equal to n1 and n3. If it is set it as max. Otherwise, set n3 as max

Check if n1 is smaller than or equal to n2 and n3. If it is set it as min. If not, check if n2 is smaller than or equal to n1 and n3. If it is set it as min. Otherwise, set n3 as min

Print the max and min

Inside the main:

Call the minMax() with different combinations

Comprehension s best described as the ability to

Answers

Answer:

The ability to understand

Explanation:

Answer:

recognize reading strategies.

Explanation:

HELP URGENTLY!!!!!

Elly supervises an eye doctors office. The office recently received new equipment. To keep that equipment working accurately and dependably, she should:
(Select all that apply.)

Copy the users manual and distribute to all the employees
Identify individuals to complete the tasks
Create a log to document maintenance
Set up auto reminders
Read the manual
List the maintenance tasks
Establish the frequency of the maintenance tasks
Update the software in the office

Answers

Note that where Elly supervises an eye doctor's office, and the office recently received new equipment, to keep that equipment working accurately and dependably, she should:

Copy the users manual and distribute to all the employeesCreate a log to document maintenanceSet up auto remindersRead the manualList the maintenance tasksEstablish the frequency of the maintenance tasksUpdate the software in the office.

What is the rationale for the above response?

In order to ensure that the equipment is working properly and optimally, Elly should distribute the user manual to all employees.

In addition, she should identify individuals to complete maintenance tasks, create a log to document maintenance, set up auto reminders, read the manual, list the maintenance tasks, establish the frequency of the maintenance tasks, and update the software in the office to keep new equipment working accurately and dependably. This will ensure optimal equipment maintenance and lifetime.

Learn more about equipment maintenance:

https://brainly.com/question/21853224

#SPJ1

Your manager has tasked you with implementing security controls to mitigate IP spoofing attacks against your network. IP spoofing is a method of attack that involves sending packets to a target network while hiding the attacker's address using a false source address.

What method outlined would achieve anti-spoofing, to mitigate private IP spoofing attacks against your network?

Answers

Answer:

You can setup firewall rules with for example iptables on Linux. The rules should block source addresses of private IP ranges such as 192.168.*.* and 10.*. *. * etc. Check private IP ranges for full list.

It will however not guarantee prevention of IP spoofing in general as its not possible to prevent such attacks. Its the responsibility of ISPs. But the question asked for private IP spoofing and then the above works.

A wireless network administrator is using 3 access points (APs) to cover an area. At some locations, all 3 APs may be in range of a single wireless device. What wireless channels should be assigned to the APs?

(Hint: Pick 3 different channels.)

a. 6
b. 7
c. 1
d. 3
e. 2
f. 4
g. 5
h. 8
i. 10
j. 9
k. 11

Answers

Answer:

A, C, and K

Explanation:

Wireless networks use access points ( APs) for wireless communication. The APs provide a collision avoidance channel for the connected devices. Devices communicating at a channel of a given frequency would experience signal interference, so all the connected APs in a wireless network is configured to operate in different channels with considerable differences in their frequencies.    

The concept of the value chain focus on

Answers

Answer:

The overarching goal of a value chain is to deliver the most value for the least cost in order to create a competitive advantage.

Your Welcome:)

One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a number of miles as an argument and returns the number of laps. Complete the program to output the number of laps. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}'.format(your_value))

Ex: If the input is: 2.2 the output is: 8.80 Your program must define and call the following function: def miles_to_laps(user_miles)

Answers

Answer:

def miles_to_laps(user_miles):

   laps = user_miles / 0.25

   

   return laps

 

miles = float(input("Enter number of miles: "))

print('{:.2f}'.format(miles_to_laps(miles)))

Explanation:

Create a function named miles_to_laps that takes one parameter, user_miles

Inside the function, calculate the number of laps, divide the user_miles by 0.25 (Since it is stated that one lap is 0.25 miles). Return the laps

Ask the user to enter the number of miles

Call the function with that input and print the result in required format

If a small cheap computer can do the same thing as a large expensive computer,
why do people need to have a large one?

Answers

Answer:

Large ones are for more important thing. Such as gaming and special software.

Explanation:

Hope that helps

Large systems are the ones that are for more important thing. Such as gaming and special software.

Why is the size of a computer Important?

Computer scientists and users value the classification of computers based on their size. It enables us to classify the computer system according to its size and processing capacity.

For gamers who desire the greatest possible gaming experience, expensive PCs are also wonderful.

You can play the most recent games smoothly and at high settings if you have a powerful computer. A costly PC also has the benefit of lasting longer than a less expensive model.

Most computer monitors have a diagonal measurement from corner to corner that falls between 19 and 34 inches. 22 to 24" screens will be sufficient for the majority of users.

Thus, it can be beneficial to use larger computers also.

For more details regarding computers, visit:

https://brainly.com/question/21080395

#SPJ2

briefly describe what a variable is

Answers

Answer:

In mathematics, a variable is a symbol or letter, such as "x" or "y," that represents a value. In algebraic equations, the value of one variable is often dependent on the value of another. Variables are also used in computer programming to store specific values within a program

Explanation:

Write a method that accepts two string arrays and print common values between the two arrays (Perform case sensitive search while finding common values).

Answers

Answer:

public class Main

{

public static void main(String[] args) {

 String[] s1 = {"Hi", "there", ",", "this", "is", "Java!"};

 String[] s2 = {".", "hi", "Java!", "this", "it"};

 findCommonValues(s1, s2);

}

public static void findCommonValues(String[] s1, String[] s2){

    for (String x : s1){

        for (String y : s2){

            if(x.equals(y))

                System.out.println(x);

        }

    }

}

}

Explanation:

*The code is in Java.

Create a method named findCommonValues that takes two parameters, s1 and s2

Inside the method:

Create a nested for-each loop. The outer loop iterates through the s1 and inner loop iterates through the s2. Check if a value in s1, x, equals to value in s2, y, using equals() method. If such a value is found, print that value

Inside the main method:

Initialize two string arrays

Call the findCommonValues() method passing those arrays as parameters

how can i fix my code so that a teepee is properly formed? here is what i currently have (my output is uploaded as an image):

public static void teepee(int a){
for(int i=a; i>0; i--){
for(int j=a; j>0; j--){
System.out.print(" ");
}
System.out.print("/");
for(int k=i; k System.out.print(" ");
}
System.out.println("\\");
}
}

Answers

We are not sending them any other one tryin was there to a point that they had been doing the work for the first

You are adding more features to a linear regression model and hope they will improve your model. If you add an important feature, the model may result in.
1. Increase in R-square
2. Decrease in R-square
A) Only 1 is correct
B) Only 2 is correct
C) Either 1 or 2
D) None of these

Answers

Answer:

The answer is "Option A".

Explanation:

Add extra functionality, otherwise, it increases the R-square value, which is defined in the following points:      

To incorporate essential elements, R-square is explicitly promoted. It Increases the R-square value, which is an additional feature. It removes the features, which provide the value of the reduce R-square. After incorporating the additional features is used as the model, which is R-square, which is never reduced.

If you want a language that is relatively easy to write and which can be tested easily as it's being developed, you would choose an interpreter program.
a) True
b) False

True
False

Answers

Answer:

true

Explanation:

because it needs a interpreter so that it could be more developed

Other Questions
4.) At an ice cream shop the ratio of chocolate ice cream cones to vanilla ice creamcones sold is 5 to 3. Using this ratio, if 25 chocolate ice cream cones are sold in aday, how many vanilla were sold that same day. Draw, label and use a tape diagram orother method that you've been taught to solve. Write your answer in sentenceform.(2pt) OMG GUYS HELP ASAP!!! who is rich one adopt me rob.lox only answer if you are tell me your user and your best pet thx guys byeeee! having trouble please help I WILL MARK BRAINLYEST How are zinc and sodium alike? A.they are both solids at room temperature.B.they have the same hardness at room temperature.C.they have the same boiling point.D.they have the same color. how did george washington show his civic virtue Do you believethat you should have to identifyyour race and/or ethnic identitywhen applying for college? Why? Identify Organelles in an Animal CellLabel ABDONELabel BDONELabel aDONELabel DDONE Subtract 7b(2a 2 +5a-7) from (7a 2 -a+3 )-3b(6a 2 -b+3) Whats the effect?A wave enters a new medium perpendicular to the boundary between the two media. It takes Rebekka 1/2 hour to jog 1 1/4 miles.Which calculation could be used to find her unit rate in miles per hour?A. multiply: 1 1/4 x 1/2B. multiply: 1/2 x 2C. divide: 1 1/4 / 1/2D. divide: 1/2 / 1 1/4 Henry places x marbles into an empty bucket.Each marble has the same weight. The weight, in ounces, of the bucket and marbles can be calculated using the expression shown Student answers 90% of the questions on the math exam correctly if she answers 27 questions correctly how many questions are on exam what is the x intercept of the line what is one reason why some western cities may not have developed good public transportation systems Reynold is writing a news story about the government handling a health epidemic. He reads a report from a different news organization to use as a reference. His deadline for the story is coming up soon, so Reynold heavily paraphrases parts from the other organization's report to help him write. While Reynold's story also includes some of the same quotes as the other report, he forgets to attribute the sources at the end. Reynold says that since no one can copyright the facts of world news, he is not plagiarizing. a) What unethical or illegal actions has Reynold taken in writing his news article? (3 points) b) What kind of consequences might result from Reynold's actions? (2 points) Solve this Literal EquationSolve for xE=[tex]\frac{ab}{x^2}[/tex] Translate this sentence into an equation 20 less than Jenny's score is 66? What is the most common process of fossilization After a business designates categories of expense in its budget, it a: applies a formula. b: appoints an accountant. c: allocates a dollar amount. d: attaches a time limit. True or False: There are more air particles in a closed syringe when the air is compressed.