Skip to main content
Software Engineering

Questions tagged [array]

An array is a systematic arrangement of similar objects, usually in rows and columns.

Filter by
Sorted by
Tagged with
16 votes
10 answers
5k views

C#'s Aversion to Array

I have noticed in documentation, looking at open-source code bases, and just a general sense in the industry that C# developers largely prefer to use List<> or IEnumerable<> over simple ...
K0D4's user avatar
  • 423
1 vote
1 answer
74 views

Is there an idiom for specifying axes and dimensions of array(-like) parameters? [closed]

Many programming languages have functions which take a parameter which is a potentially-multi-dimensional array, where the number of axes and the dimension in each axis is not specified in code. This ...
0 votes
1 answer
219 views

Elegant way in C to store many parameters with default value and current value in embedded flash

I'm programming an embedded system that has a number of user configurable parameters, which are stored in flash memory. I have to store a default value for each parameter as well as the user settings. ...
0 votes
1 answer
598 views

Array structure for nested grouping (JavaScript)

I am currently struggling with how to solve nested grouping of data. The initial structure is given and my grouped structure below as well as my approach can be adjusted. My idea was to have the array ...
Dollique's user avatar
  • 101
27 votes
6 answers
26k views

How can Rust be "safer" and "faster" than C++ at the same time?

I have been told that Rust is both safer and faster than C++. If that is true, how can that be even possible? I mean, a safer language means that more code is written inside the compiler, right? More ...
euraad's user avatar
  • 403
-2 votes
3 answers
144 views

What are the pros and cons of different combinations of objects and arrays for data storing?

From the article JavaScript 2D Array – Two Dimensional Arrays in JS, I see one way to store data is to put all properties of each element into one array: let dataRepresentation1 = [ ['John Doe', ...
4 votes
4 answers
1k views

When should tuples be used as an argument instead of an array?

I hope this isn't too off-topic/opinion-based, I'm new here. I want to pass three elements of the same type into a function. The three elements are unique cards of a deck of cards, so they're not ...
0 votes
4 answers
2k views

What prevents Java from having immutable primitive arrays?

Java never had immutable primitive arrays. However Java does have an immutable List or Map or other collection classes and of course final primitive fields and variables. In Java if you try to make an ...
CPlus's user avatar
CPlus
  • 1,229
7 votes
2 answers
4k views

Why does C not support direct array assignment?

In C you cannot assign arrays directly. int array[4] = {1, 2, 3, 4}; int array_prime[4] = array; // Error At first I thought this might because the C facilities were supposed to be implementable with ...
CPlus's user avatar
CPlus
  • 1,229
0 votes
3 answers
133 views

How multiple type lists are stored in memory?

Arrays are stored in a linear fashion, with memory cells of fixed size for each element. To have fixed sized memory cells Arrays should be homogenious. So in Arrays we get an Nth element by skipping ...
forty5's user avatar
  • 39
4 votes
2 answers
2k views

Multidimensional vs nested arrays

A seemingly basic question here. Is there anything you can do with multidimensional arrays that you can't do with nested arrays? Many languages have been designed with both facilities and syntactical ...
Steve's user avatar
  • 12.4k
0 votes
0 answers
58 views

JavaScript: My logic traversing multi-dimensional arrays

Consider the following: Let's say below is the multi-dimensional, and you are given the starting point of [2, 2]. const WORLD = [ ['P', 'P', 'P', 'C', 'P'], ['P', 'M', 'P', 'C', 'P'], ...
0 votes
0 answers
153 views

Best choice for a holding large number of objects in java

I have a set of array, containing a large number of objects (products), which has lately grown so large, searching in it takes about a minute, which is considered too long, since one search is ...
kry's user avatar
kry
  • 101
2 votes
2 answers
3k views

JS - two array filters vs. one forEach?

I've had a question for a while. I know that the Array prototype method filter is generally preferred over forEach, and I believe it is typically faster at the job as well. But what about if I have ...
2 votes
1 answer
2k views

Do C++ compilers optimize/pack small data types (e.g. boolean values)?

This occurred to me when looking at stencil computations in numpy. This python library compiles compute-intensive components, so I believe that it's a valid example. Here making selections on an array ...

15 30 50 per page
1
2 3 4 5
...
15

AltStyle によって変換されたページ (->オリジナル) /