Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help in this. Must be in Java. You will have to translate on google translate. i dont have english version of it. Escriba un

Need help in this. Must be in Java. You will have to translate on google translate. i dont have english version of it.

Escriba un programa con Java que imprima las listas despus de llamar a los siguientes mtodos.

Medthod removeOddLength: toma una ArrayList de cadenas como parmetro y elimina todas las cadenas de longitud impar de la lista.

Mtodo swapPairs: cambia el orden de los valores en una ArrayList de cadenas de una manera por pares. Su mtodo debe cambiar el orden de los dos primeros valores, luego los dos siguientes, luego los dos siguientes y as sucesivamente. Si el nmero de valores de la lista es impar, el mtodo no debe mover el elemento final. Por ejemplo, si la lista almacena ["seora", "yo", "soy", "su", "adn"], su mtodo debera cambiar el contenido de esta lista a ["yo", "seora", "su", " soy , adn ]

Mtodo de interseccin: acepta dos listas de matrices ordenadas de enteros como parmetros y devuelve una nueva lista que contiene solo los elementos que se encuentran en ambas listas. Por ejemplo, si las listas llamadas list1 y list2 almacenan inicialmente:

[1, 4, 8, 9, 11, 15, 17, 28, 41, 59]

[4, 7, 11, 17, 19, 20, 23, 28, 37, 59, 81]

Luego, la llamada de intersect (list1, list2) devuelve la lista:

[4, 11, 17, 28, 59]

Imprima la lista que devuelve este mtodo.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

The mean for a sample with n = 250 andx=4500 is

Answered: 1 week ago

Question

What is the primary role of advertising in IMC?

Answered: 1 week ago

Question

Create a corporate story for a company with which you are familiar.

Answered: 1 week ago

Question

Find examples of good corporate advertising.

Answered: 1 week ago