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
Yakvenalex [24]
2 years ago
14

An ALGORITHM IS? PLEASE HELP

Computers and Technology
1 answer:
JulsSmile [24]2 years ago
8 0

Answer:

A set of instructions or set of rules.

You might be interested in
Write a method transpose, that takes as argument a 2D array of integers, myTable, and returns the transpose of myTable. The tran
Gelneren [198K]

Answer:

The program to this question can be given as:

Program:

import java.util.*; //import package

public class Main //defining class

{

public static int[][] transpose(int[][] a1) //defining function transpose

{

int i,j; //define variables

int[][] transpose = new int[a1[0].length][a1.length]; //define variable transpose.

//loop for transpose matrix.

for(i = 0; i < a1.length; i++)  

{

for(j = 0; j < a1[i].length; j++)

{

transpose [j][i] = a1[i][j]; //hold value in transpose variable

}

}

return transpose ; //return transpose matrix.  

}

public static void main(String[] args) //main method.

{

int row,col,i,j; //defining variable.

Scanner obj = new Scanner(System.in); //creating Scanner class Object

System.out.print("Enter number of rows: ");//message

row = obj.nextInt(); //input rows form user.

System.out.print("Enter number of columns: ");//message

col = obj.nextInt(); //input columns form user.

int[][] a1 = new int[row][col]; //defining array.

System.out.println("Enter matrix"); //message

// loop for input array elements from user

for(i=0; i<a1.length;i++)  

{

for(j=0; j<a1[i].length;j++)  

{

a1[i][j]=obj.nextInt(); //input in array variable.

}

}

System.out.println("Matrix you insert :"); //message

// loop for display array.

for(i=0; i<a1.length;i++)  

{

for(j=0; j<a1[i].length;j++)  

{

System.out.print(a1[i][j]+" "); //print matrix

}

System.out.print("\n");

}

int[][] result = transpose(a1); //define result array variable that holds function value.

System.out.println("Transposed matrix is :");

//use loop for print Transpose matrix.

for(i = 0;i < result.length;i++)

{

for (j = 0; j < result[i].length;j++)

{

System.out.print(result[i][j] + " "); //print matrix

}

System.out.print("\n");

}

}

}

Output:

Enter number of rows: 2

Enter number of columns: 3

Enter matrix

2

3

4

9

8

7

Matrix you insert :

2 3 4  

9 8 7  

Transposed matrix is :

2 9  

3 8  

4 7  

Explanation:

The description of the above program can be given as:

  • In the above program firstly import a package, then declare a class that is "Main" inside a class defining a transpose() function this function returns a matrix in transpose form.
  • In the main class, we define a variable and matrix that is "row, col, i, j and a1[][]".  Then we Creating a scanner class object, which is used by row, col and a1[][] variables for user input.  
  • The row and col variables are used to declare matrix size and i, j variable is used in the loop for insert and display matrix.  
  • a1[][] matrix is used for input matrix elements and passes into transpose() function as an argument that returns a value that is held in the result variable. This is used as a loop for the print transpose matrix.

5 0
3 years ago
Suppose that the following elements are added in the specified order to an empty binary search tree: Lisa, Bart, Marge, Homer, M
Alecsey [184]

Answer:

Pre-order: Lisa, Bart, Homer, Flanders, Marge, Maggie, Smithers, Milhouse

In-order: Bart, Flanders, Homer, Lisa, Maggie, Marge, Milhouse, Smithers

Post-order: Flanders, Homer, Bart, Maggie, Milhouse, Smithers, Marge, Lisa

Explanation:

The required orders are mentioned.

4 0
3 years ago
Which of the following is not possible? A class that implements two interfaces. A class that inherits from two classes. A class
ozzi

Answer:

"A class that inherits from two classes"

Explanation:

If we're talking about Java, you can't extend from two classes. The reason for this is Java doesn't allow multiple inheritance.

The reason for this is to avoid the ambiguity caused by it. One of the cases where multiple inheritance can cause ambiguity is the diamond problem.

Diamond problem can occur if two classes (say B and C) inherit from one class (say A). And another class (say D) inherits from both B & C.

If B and C class override the same method from A class. And D class calls that method, which one will be called, class B's or C's??

4 0
3 years ago
Using the flowchart diagram, identify the decision point of this solution. Identify vendors. Calculate amount due. Determine dat
andreev551 [17]

Answer:

answer is "is there an early pay discount"

Explanation:

3 0
3 years ago
Read 2 more answers
How many different messages can be transmitted in n microseconds using three different signals if one signal requires 1 microsec
SIZIF [17.4K]

Answer:

a_{n} = 2/3 . 2^n + 1/3 . (-1)^n

Explanation:

Let a_{n} represents number of the message that can transmitted in <em>n </em>microsecond using three of different signals.

One signal requires one microsecond for transmittal: a_{n}-1

Another signal requires two microseconds for transmittal: a_{n}-2

The last signal requires two microseconds for transmittal: a_{n}-2

a_{n}= a_{n-1} + a_{n-2} + a_{n-2} = a_{n-1} + 2a_{n-2}, n ≥  2

In 0 microseconds. exactly 1 message can be sent: the empty message.

a_{0}= 1

In 1 microsecond. exactly 1 message can be sent (using the one signal of one  microseconds:

a_{0}= 1

2- Roots Characteristic equation

Let a_{n} = r^2, a_{n-1}=r and a_{n-2}= 1

r^2 = r+2

r^2 - r - 2 =0                 Subtract r+6 from each side

(r - 2)(n+1)=0                  Factorize

r - 2 = 0 or r +1 = 0       Zero product property

r = 2 or r = -1                 Solve each equation

Solution recurrence relation

The solution of the recurrence relation is then of the form a_{1} = a_{1 r^n 1} + a_{2 r^n 2} with r_{1} and r_{2} the roots of the characteristic equation.

a_{n} =a_{1} . 2^n + a_{2}.(-1)"

Initial conditions :

1 = a_{0} = a_{1} + a_{2}

1 = a_{1} = 2a_{1} - a_{2}

Add the previous two equations

2 = 3a_{1}

2/3 = a_{1}

Determine a_{2} from 1 = a_{1} + a_{2} and a_{1} = 2/3

a_{2} = 1 - a_{1} = 1 - 2 / 3 = 1/3

Thus, the solution of recursion relation is a_{n} = 2/3 . 2^n + 1/3 . (-1)^n

6 0
3 years ago
Other questions:
  • PLZ HELP ME! What is a false statement about online time?
    9·1 answer
  • Create a detail report that will display all SCR courses in alphabetical order, with the course name and the instructor name in
    5·1 answer
  • In order to plan George's birthday, his father gave him a list of people who attended his birthday for the last five years. What
    5·1 answer
  • Mark for review (Will be highlighted on the review page) 11. A feature in Excel that allows you to graphically display in a sing
    10·1 answer
  • Robert is leading a project online that includes students from different cultures. Two of the students spend most of the time li
    7·1 answer
  • Which component of the windows desktop allows you to retrieve files that have recently been deleted?
    11·1 answer
  • What can your employer do to protect you from overhead power lines?
    13·1 answer
  • If the supply of computer engineers increases at the same time that the demand for these workers decreases, what would be the MO
    7·1 answer
  • Match the following.
    8·1 answer
  • What is remote assistance?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!