
Sign up to save your podcasts
Or


O que te faz feliz humano?
A dictionary is a mapping where each key is mapped to a single value. If you want to map keys to multiple values, you need to store the multiple values in another container such as a list or set;
To easily construct such dictionaries, you can use defaultdict in the collections module. A feature of defaultdict is that it automatically initializes the first value so you can simply focus on adding items;
#AQUI EU CRIO DOIS FOR, PORQUE EU PRECISO ANALISAR ITEM POR ITEM DA MATRIZ QUE FOI CRIADA;
Preciso estudar código, sem criatividade para descrição;
void insertAfter(Node* previous, int value) // logo, eu preciso ser um ponteiro de um ponteiro.
{
//1. verificar se previous não é NULL;
if(previous == NULL)
{
cout << "Previous can not be NULL";
return;
}
//2. Preparar o novo Node;
Node* newNode = new Node();
newNode->Data = value;
//3. Inserir o novo Node depois de previous;
newNode->next = previous->next; //o que o meu Node a está apontando, meu novo Node aponta
previous->next = newNode; // O Node A aponta para o novo Node;
}
int main ()
{
std::vector nums = {1};
int val = 0;
int pos = 0;
bool check = false;
auto i = nums.begin();
while (i !=nums.end())
{
if((*i) != val)
{
i++;
pos++;
}
else
{
check = true;
break;
}
}
if (!check)
{
pos = 0;
auto j = nums.begin();
while (j != nums.end())
{
if (val > (*j))
{
j++;
pos++;
}
else
{
check = true;
break;
}
}
}
cout << pos << std::endl;
for(int x : nums)
{
cout << x << "\t";
}
return ;
}
Pedimos desculpas pelo problema do audio, real :x
O episódio está massa, mas será que você vai procrastinar para ouvir?
From the publisher's feed