Questions tagged as 'array'

6
answers

Function that lists letters of the alphabet

How to convert the letters of the alphabet into an array of numbers according to its sequence? The array should start from # 1, not zero. So the letter A would be 1 , B would be 2 , C would be 3 , an...
asked by 15.03.2015 / 17:01
3
answers

How to optimize the sum of the elements of an array

I need to get the value of the sum of the items of a array in JavaScript. The amount of these items can easily reach 2,000 items. Items are of type int , no testing required. ar = [1,3,5,...,2000]; I already have a array...
asked by 27.10.2016 / 18:07
3
answers

Convert array of objects to array of arrays

How to perform string conversion (array of objects): [ {"id":1,"nome":"Maluf","cpf":"007.519.591-20"}, {"id":2,"nome":"Paulo Ricardo","cpf":"565.232.591-02"}, {"id":3,"nome":"Joaquim Barbosa","cpf":"007.519.699-32"}, {"id":4,"nome"...
asked by 29.12.2015 / 17:15
2
answers

user tree with points and profile in C #

I have a list of users who each have a sponsor (sponsor is also a user). Each user has points and is of one type. I want to know which branch of the tree has the highest number of points, and for each branch know how many equal types I have. Sup...
asked by 01.06.2015 / 23:39
1
answer

Why do we use parentheses in a pointer declaration?

What's the difference between these two statements? int* array1[10]; int (*array2)[10]; Why are there parentheses in the second?     
asked by 10.01.2017 / 11:36
1
answer

Why is the index of arrays and other sequences starting at zero?

Why array does not start with 1. Is there any technical reason to have adopted 0?     
asked by 13.02.2017 / 15:10
1
answer

Difference between std :: list, std :: vector and std :: array

All containers used to guard data sequentially, but what are the main differences between them?     
asked by 04.11.2016 / 17:30
1
answer

Array parameter passing error

I'm trying to understand how pointers work for an array. For this, I elaborated the small program below. I made some mistake because, in the line indicated, segmentation fault is occurring. What is the correct way to pass the pointer pointi...
asked by 14.12.2014 / 17:26
1
answer

What is an Array-Like?

A given string is an array-like, and a given number is not. Already their respective objects are array-likes (the objects themselves), right? An object declared, a DOM Object is also an arraylike, correct? Everything is array-like minus boolean...
asked by 10.11.2014 / 23:25
1
answer

Count sequences of 1 within vector in R

I would like to know how to count sequences of 1 within a vector containing only 0 and 1. For example, in the x <- c(1, 1, 0, 0, 1, 0, 1, 1) vector, the count would give the (2, 1, 2) vector, which counts the sequence of 2 "1",...
asked by 12.11.2017 / 01:24