Design an algorithm to find all the common elements in two sorted lists of numbers. For example, for the lists (2, 5, 5, 5)
and (2, 2, 3, 5, 5, 7), the output should be (2, 5, 5).

Answers

Answer 1
Answer:

Answer:

while list1 not empty AND list2 not empty {

    if elements at leftmost positions are equal {

        pop element from list1

        pop element from list2

        add element to result_list

    } else {

        pop lowest value from list1 or list2

    }

}


Related Questions

Use the STL class vector to write a C function that returns true if there are two elements of the vector for which their product is odd, and returns false otherwise. Provide a formula on the number of scalar multiplications in terms of n, the size of the vector, to solve the problem in the best and worst cases. Describe the situations of getting the best and worst cases, give the samples of the input at each case and check if your formula works. What is the classification of the algorithm in the best and worst cases in terms of the Big-O notation
The ____ area on the status bar includes six commands as well as the result of the associated calculation on the right side of the menu.
Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and enhancing the quality of interaction between the citizen-consumer within all branches of government. Group of answer choices
What does I/O mean in computing​
Python code 100 Random Numbers (twice)python codeinstructions:You need to write code that will print two bricks of numbers, one with integers, one with decimals.

Which of the following statements is NOT true regarding the Security Configuration and Analysis (SCA) tool?a. It evaluates the current security state of computers in accordance with Microsoft security recommendations.
b. It allows an administrator to analyze a computer and compare its configuration settings with a baseline.
c. It can apply a baseline to force current computer settings to match the settings defined in the baseline.
d. It uses security templates to store the settings that make up baselines.

Answers

Answer: a. It evaluates the current security state of computers in accordance with Microsoft security recommendations

Explanation:

The Security Configuration and Analysis tool allows the configuration of local computers through the application of the settings in a security template to the local policy.

This allows an administrator to analyze a computer and compare its configuration settings with a baseline. The Security Configuration and Analysis (SCA) tool also uses security templates to store the settings that make up baselines.

Therefore, based on the options given, the correct option is A as the SCA tool doesn't evaluate the current security state of computers in accordance with Microsoft security recommendations.

Insert the missing code in the following code fragment. This fragment is intended to implement a method to set the value stored in an instance variable. Public class Employee
{
Private String empID;
Private boolean hourly;
) . .
_______
{
Hourly = isHourly;
}
}
A) public void setHourly(String isHourly)
B) public void getHourly()
C) public boolean getHourly()
D) public boolean setHourly(boolean isHourly)

Answers

Answer:

A)

Explanation:

In this code example the missing piece of code would be...

public void setHourly(String isHourly)

This piece of code is creating a function called setHourly which takes in one String variable as it's parameter. Based on the rest of the code, the function takes that parameter variable and places it into an instance variable called Hourly which can be used when the function is called.

To return the value of the cell D8, the formula should be OFFSETA1=________.

Answers

Answer:

The formula is =OFFSET( A1, 7,3,1,1 )

Explanation:

Microsoft excel is a statistical and analytical tool for data management and analysis. Its working environment is called a worksheet. The worksheets are made up of rows and columns also known as records and fields respectively.

Functions like OFFSET in excel is used to return a cell or group of cells. It gets the position to turn by start getting a starting port, then the number of records below it and the fields after, then the length and width of cells to return.

syntax:   =OFFSET( "starting cell", "number of rows below", "number of columns after", "height of cells to return", "width of cells to return" )

What decision-making style most likely requires the most amount of data analysis?

Answers

The analytical decision-making style most likely requires the most amount of data analysis.

Define data analysis.

Data analysis is the process of systematically inspecting, cleaning, transforming, and modeling data with the goal of discovering useful information, drawing conclusions, and supporting decision-making. Data analysis is used in a wide range of fields, including business, science, social sciences, and engineering, to extract insights from raw data and identify patterns, trends, and relationships. The process of data analysis typically involves using statistical and mathematical techniques, as well as visualization tools, to interpret and communicate the results of the analysis.

The analytical decision-making style is most likely to require the most amount of data analysis. Analytical decision-making involves a methodical and thorough approach to gathering and analyzing data before making a decision. This style of decision-making is often used in complex or high-stakes situations, where there are many variables to consider and the consequences of a poor decision could be significant. Analytical decision-making involves collecting data from multiple sources, analyzing the data using various methods, and making a decision based on the results of the analysis. This style of decision-making can be time-consuming and requires a significant amount of data analysis to ensure that all relevant information has been considered before making a decision.

To learn more about the data analysis click here

brainly.com/question/1906563

#SPJ1

Which of the following sorting algorithms is described by this text? "Take the item at index 1 and see if it is in order compared to the item at index 0. If it is not, then swap the two items. Next take the item at index 2 and compare it to the items at the lower indexes. Move items in the lower indexes to a higher one until you find the proper location to place the value so that it is in the correct order. Continue this process with all remaining indexes."a. Insertion sort
b. Heap sort
c. Merge sort
d. Quick sort
e. Selection sort

Answers

Answer:

a. Insertion sort

Explanation:

Insertion Sort is a sorting algorithm that places the input element at its suitable place in each pass.

Insertion sort is based on the idea that one element from the input elements is consumed in each iteration to find its correct position.

Does the following code return a string or a number def of() return 3

Answers

Answer:

The system cannot find the path specified.

Explanation:

please give brain thx! :D

good luck!