Questions tagged as 'lista'

1
answer

Error when printing static list

How do I print to my static list? #include <stdio.h> #include <stdlib.h> #define MAX 3 struct alunos { int matricula; char nome[30]; float nota1, nota2; }; typedef struct lista { int quant; struct alunos dado...
asked by 10.10.2016 / 18:05
6
answers

how to search for an element in a list that is within another list?

   I have the following list of lists. [['julian', '0', '5'], ['ana', '10', '4']]    I need to use a function that tells me the position of any element within that list, I tried to use: elemento = lista.index('julian') print (elemento)...
asked by 05.06.2017 / 08:55
2
answers

Pass generic list as parameter

Is it possible to pass a generic list by parameter? Ex: I have List<Pessoa> and List<object> . and I have my method: public void FaçaAlgo(List<T> lista) { } How can I get my method to receive both Lis...
asked by 29.04.2015 / 15:25
3
answers

Is it possible to place objects in an ArrayList as soon as it is instantiated?

Doubt applies not only to ArrayList , but to any type of List . Is it possible to add objects to ArrayList soon after we instantiate it, and without having to use the add() method? How can this be done with arrays ?...
asked by 05.01.2018 / 01:16
3
answers

Assemble a single string with several strings of an ArrayList in Java

How can I get multiple Strings from an ArrayList in a simplified way and merge into just one string variable? I'm new to Java and I'm having trouble completing this change in a simplified way, avoiding long, unnecessary lines of code. List<...
asked by 17.06.2015 / 22:21
2
answers

How do I update an item from a generic list?

I'm trying to change the name and email of a certain item from the list below, but found no way other than to remove the item from the list and add it upgraded again. Is there another way to update? class Program { static void Main(string[...
asked by 16.09.2015 / 20:48
4
answers

"Filter" equal records in a list by adding their quantitative

namespace ConsoleApplication10 { class Program { static void Main(string[] args) { List<Teste> lstTeste = new List<Teste> { new Teste {Codigo = 1, Quantidade = 10},...
asked by 22.09.2015 / 22:22
2
answers

Data Structure - Double C-Linked List

I am doing an activity proposed by a teacher, which asks you to remove an element from the end of a double chained list. But the function I put together to solve the problem is locking the program. In the resolution I thought that if it were mad...
asked by 13.01.2015 / 13:01
3
answers

Sort List in java

I have List<Pessoa> where the attributes of the object are: Name, age, address, etc. I have a Screen where I insert people in this list and generate a report, I would like to display this object sorted by Name. How can I do this?  ...
asked by 15.07.2015 / 18:29
2
answers

How to make a range with alphabet letters in python?

In PHP, when we want to do array of letters of the alphabet, we can use the function range . Example in PHP: $letras = range('a', 'z'); Result: Array ( [0] => a [1] => b [2] => c [3] => d [4...
asked by 13.08.2015 / 15:25