Find Jobs
Hire Freelancers

need data structure help

₹100-400 INR / hour

Terminado
Publicado hace casi 7 años

₹100-400 INR / hour

QUESTIONS Let list1 and list2 contain arbitrary number of items. Describe briefly what the following code snippet does: while (![login to view URL]()) { [login to view URL]([login to view URL](), [login to view URL](0)); } Suppose the design requirement for the following code is to remove every other item from a given list. for (int i = 0; i < [login to view URL](); i += 2) { [login to view URL](i); } If colors initially contains ["violet", "indigo", "blue", "green", "yellow", "orange", "red"], then trace the code on this input by showing the value of i, value of [login to view URL]() and contents of colors for each execution of the for loop body. To receive full credit, you should start by showing the initial values before the loop execution begins and then show results after each execution of the for loop, until you show the final results. Use this format for your answer: i = unInitialized, [login to view URL]() = ..., colors = [...] and then i = 0, ... Does the code work as per the design requirement? Explain your answer briefly. Assume the following: The Iterator<E> interface is as discussed in lecture. The ArrayList<E> class implements the Iterable<E> and ListADT<E> interfaces. The items in a list can be compared with the equals method or the compareTo method. Complete the Java method specified below, making use of iterators Hint: You would need a lot of them!. Assume this method is implemented in a main class. To receive full credit, your solution: must explicitly use iterators for traversing lists must not use the contains method must not modify the contents of the parameter public static <E> ArrayList<E> flatten(ArrayList<ArrayList<E>> list) { // If list is null, throw a NullPointerException. // If list is empty, return a new empty list. // Otherwise create and return a new list that contains the objects contained in // any of the lists contained in list, removing duplicate items. The order of // items in the returned list should be the same as the order in which they // first appear in the original list. //Example: list: [[1,2,3], [4,3,6], [1,5]] result: [1,2,3,4,6,5]
ID del proyecto: 14455066

Información sobre el proyecto

17 propuestas
Proyecto remoto
Activo hace 7 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
First answer: You move all item from list1 to list2. Remove Second answer: the code will node work as design because the size method will change everytime you remove an element. Third answer: public static <E> ArrayList<E> flatten(ArrayList<ArrayList<E>> list) { ArrayList<E> result = new ArrayList<>(); if (list == null) { throw new NullPointerException(); } for (ArrayList<E> l : list) { [login to view URL](l); } return result; }
₹100 INR en 40 días
4,6 (5 comentarios)
2,2
2,2
17 freelancers están ofertando un promedio de ₹275 INR /hora por este trabajo
Avatar del usuario
Good Day! i'm expert java dev with more than 7 years experience in IT area working with cutting edge technologies for both web application and software development. Kindly Regards
₹333 INR en 40 días
4,9 (21 comentarios)
5,1
5,1
Avatar del usuario
I've been writing codes in Python for 4 years and I can get the task done. I'm very good with DS, algorithms and have no problem converting any ideas into code
₹100 INR en 40 días
4,9 (31 comentarios)
4,5
4,5
Avatar del usuario
Hello guy. I've experienced in Java and algorithm. So please contact me directly for more discussion. thanks a lot
₹277 INR en 40 días
4,7 (11 comentarios)
3,8
3,8
Avatar del usuario
I will do this for 12$
₹440 INR en 3 días
4,6 (3 comentarios)
2,2
2,2
Avatar del usuario
hey this is kartikeya, i have 3+ years of experience in c/c++. I have done many projects for students here. Check my reviews. I have read the questions here and can do the work Ping me
₹277 INR en 40 días
5,0 (4 comentarios)
1,5
1,5
Avatar del usuario
A proposal has not yet been provided
₹200 INR en 30 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I am expertise in data structures,c,c++,java programming languages from past 4 years in IT software industry.I have hands on experience on data structures in real time banking applications.
₹350 INR en 70 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I'll gladly help you as I've come across this kind of question before. Data structures are a frequent topic
₹222 INR en 5 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I am an experienced developer with good knowledge of Data Structures and Algorithms. New to freelancer, looking forward to starting small.
₹111 INR en 40 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I assume this a students homework. Providing an answer that doesn't help you to learn is not in your own best interest. Make a good faith attempt to solve the problem yourself first and ask about specific problems with your existing implementation. If your school has a policy regarding outside help on homework, make sure you are aware of it before you receive help. Never use code you don't understand. It definitely won't help you later (after school, in later assignments, on tests, etc.) and it could be, at best, very embarrassing if you are asked to explain code you turned in.
₹277 INR en 40 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de INDIA
Calcutta, India
4,6
121
Forma de pago verificada
Miembro desde ene 29, 2011

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.