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
guajiro [1.7K]
3 years ago
15

Three different numbers need to be placed in order from least to greatest. For example, if the numbers are ordered 9, 16, 4, the

y should be reordered as 4, 9, 16. Which of the following algorithms can be used to place any three numbers in the correct order?
Computers and Technology
1 answer:
Savatey [412]3 years ago
8 0

Answer:

what are the three different numbers?

You might be interested in
All of the following are examples of extracurricular activities except:
mart [117]
A, because normally that would be a requirment
8 0
3 years ago
Read 2 more answers
Essay : Explore an editing studio or research online about editing studios and prepare a report that describes the roles and res
olya-2409 [2.1K]

Editor is main role where he or she place proper graphics with sound effects and record the same and play and get the feedback from director and producer.

<u>Explanation:</u>

Normally editing the picture or video and remixing the video with sound are done by graphic designer, editor or sound engineer.

All three had do proper coordination to get proper output results

Graphic designer who makes the video or photo their color combinations and picture orientation.

Sound designed after the graphic mix been done sound engineer has play proper BGM and record sound.

7 0
3 years ago
There are n poor college students who are renting two houses. For every pair of students pi and pj , the function d(pi , pj ) ou
Nuetrik [128]

Answer:

Here the given problem is modeled as a Graph problem.

Explanation:

Input:-  n, k and the function d(pi,pj) which outputs an integer between 1 and n2

Algorithm:-We model each student as a node. So, there would be n nodes. We make a foothold between two nodes u and v (where u and v denote the scholars pu and pv respectively) iff d(pu,pv) > k. Now, Let's call the graph G(V, E) where V is that the vertex set of the graph ( total vertices = n which is that the number of students), and E is that the edge set of the graph ( where two nodes have edges between them if and only the drama between them is bigger than k).

We now need to partition the nodes of the graph into two sets S1 and S2 such each node belongs to precisely one set and there's no edge between the nodes within the same set (if there's a foothold between any two nodes within the same set then meaning that the drama between them exceeds k which isn't allowed). S1 and S2 correspond to the partition of scholars into two buses.

The above formulation is akin to finding out if the graph G(V,E) is a bipartite graph. If the Graph G(V, E) is bipartite then we have a partition of the students into sets such that the total drama <= k else such a partition doesn't exist.

Now, finding whether a graph is bipartite or not is often found using BFS (Breadth First algorithm) in O(V+E) time. Since V = n and E = O(n2) , the worst-case time complexity of the BFS algorithm is O(n2). The pseudo-code is given as

PseudoCode:

// Input = n,k and a function d(pi,pj)

// Edges of a graph are represented as an adjacency list

1. Make V as a vertex set of n nodes.

2. for each vertex  u ∈ V

\rightarrow  for each vertex v ∈ V

\rightarrow\rightarrowif( d(pu, pj) > k )

\rightarrow\rightarrow\rightarrow add vertex u to Adj[v]   // Adj[v] represents adjacency list of v

\rightarrow\rightarrow\rightarrow add vertex v to Adj[u] // Adj[u] represents adjacency list of u

3.  bool visited[n] // visited[i] = true if the vertex i has been visited during BFS else false

4. for each vertex u ∈ V

\rightarrowvisited[u] = false

5. color[n] // color[i] is binary number used for 2-coloring the graph  

6. for each vertex u ∈ V  

\rightarrow if ( visited[u] == false)

\rightarrow\rightarrow color[u] = 0;

\rightarrow\rightarrow isbipartite = BFS(G,u,color,visited)  // if the vertices reachable from u form a bipartite graph, it returns true

\rightarrow\rightarrow if (isbipartite == false)

\rightarrow\rightarrow\rightarrow print " No solution exists "

\rightarrow\rightarrow\rightarrow exit(0)

7.  for each vertex u ∈V

\rightarrow if (color[u] == 0 )

\rightarrow\rightarrow print " Student u is assigned Bus 1"

\rightarrowelse

\rightarrow\rightarrow print " Student v is assigned Bus 2"

BFS(G,s,color,visited)  

1. color[s] = 0

2. visited[s] = true

3. Q = Ф // Q is a priority Queue

4. Q.push(s)

5. while Q != Ф {

\rightarrow u = Q.pop()

\rightarrow for each vertex v ∈ Adj[u]

\rightarrow\rightarrow if (visited[v] == false)

\rightarrow\rightarrow\rightarrow color[v] = (color[u] + 1) % 2

\rightarrow\rightarrow\rightarrow visited[v] = true

\rightarrow\rightarrow\rightarrow Q.push(v)

\rightarrow\rightarrow else

\rightarrow\rightarrow\rightarrow if (color[u] == color[v])

\rightarrow\rightarrow\rightarrow\rightarrow return false // vertex u and v had been assigned the same color so the graph is not bipartite

}

6. return true

3 0
3 years ago
A stretching<br> force causing<br> things to be<br> pulled in<br> opposite<br> directions
tatuchka [14]

Explanation:

Please helpppp meee! I'm rn in Ukraine, the invasion has begun early this morning! My house was bombed by a russian shell. I'm hurt!!! Give me some advice!! I don't have any medical substances nearby!!

4 0
2 years ago
What is the symbol that causes the computer to perform string concatenation?
neonofarm [45]

Answer: In java the symbol "+" operator is used to perform string concatenation.

Explanation:

String concatenation refers to joining of two strings. So in java + is used to join strings which works provided one of the operands must be a String variable. Then it works by converting the other variable to String variable and joins the second operand to the end of the first operand.

An example of String concatenation is as follows:

int age = 10;

System.out.println("The boys age is " + age);

Output:

The boys age is 10.

here, the age is integer variable but as the phrase "The boys age is" is a String variable so it converts the age to String variable and joins both the Strings.

4 0
3 years ago
Other questions:
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. 
    5·1 answer
  • Assume that scotus is a two-dimensional character array that stores the family names (last names ) of the nine justices on the S
    6·1 answer
  • What are the problems with security when working on a Web Page?
    13·2 answers
  • What kind of game was pole position?
    6·2 answers
  • How to make a Tip Calculator in code?
    12·1 answer
  • The ____ class act as a switchboard between the view layer and the domain layer.
    14·1 answer
  • How did New York Governor Hugh Carey handle Sostre’s situation?
    9·2 answers
  • 3<br> Select the correct answer.<br> What is the output of the following HTML code?<br>Please
    8·2 answers
  • .NET
    15·1 answer
  • You are a software engineer at a company where management routinely encourages you and your colleagues to use pirated software.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!