maljoh7655 maljoh7655
  • 03-01-2020
  • Computers and Technology
contestada

Give pseudocode for an algorithm that removes all negative values from an array, preserving the order of the remaining elements.

Respuesta :

Algorithm
Algorithm Algorithm
  • 05-01-2020

Answer:

Begin.

WRITE  ''enter test array''

READ test array

test [ ] = new_int [ ] { enter test array here, separated by comma}

int [ ] positives = Arrays.stream(test). filter(x -> x >= 0).toArray();

System. out. println( " Positive array");

for (int i : positives) {

      System.out.print(i+ "\t");  }

WRITE  positive array

End

Explanation

The pseudocode for the  alogirithm has been simplified above, it is implemented in Java 8

Answer Link

Otras preguntas

what is an important function of a masterpiece?
If 2x + y = 23 and 4x – y = 19; find the value of x – 3y and 5y – 2x
7th grade science…. I need help
Combine all of the like terms: 10X + 4Y + X + 10
Kendall gathered the following materials for her experiment.an empty graduated cylinderan identical graduated cylinder partly filled with watera balancea marble
summary chapters 1-4 the sun trail warriors
please help me :(((((((((((((((((((9 Determine the product of the binomial −x−5 and the trinomial −2x2+3x+1. To earn full credit, show your work using a method
8. It was welded. answers a. Joined together b. Hammered carefully Set on fire d. Turned into a liquid e. Made by a group C.​
An older person is nine years older than four times the age of a younger person for some of their age is 34 find their ages
Help ME Please I need help I need help please