Skip to main content

All Questions

Tagged with
0 votes
1 answer
186 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. ...
jusaca's user avatar
  • 175
4 votes
2 answers
1k views

Arrays vs Maps for listing items that have a unique id

I've been finding that for a lot of code I've been writing recently, it naively might look like this: Array approach: const options = [ { id: 'red', label: 'Red', data: '#f00' ...
dwjohnston's user avatar
  • 2,687
0 votes
1 answer
124 views

how to store the data for function f(time,length)

I have a function which has discrete time step ,discrete length from origin . These two give height of the function. For example at time 1.2sec , and length 5.5cm from origin height is 10cm. The step ...
Mokka Naresh's user avatar
1 vote
3 answers
516 views

Are 'array elements' and 'array values' the same?

Array := {"title": "Book Title", "author": "John Doe"} Some people use the following terminology: title and author are keys. Book Title and John Doe are values. "title": "Book Title" and "author": "...
john c. j.'s user avatar
3 votes
4 answers
119 views

Store csv data as rows or columns in view of the needed processing?

Assume I have some data a csv-Files like ObjectName, PropertyA, PropertyB, PropertyC "Name1", 3, 1, 4 "Name2", 1, 5, 9 "Name3", 2, 6, 5 ... and a typical question I want to answer would be For ...
Elvorfirilmathredia's user avatar
3 votes
3 answers
668 views

Why are arrays often treated as second-class citizens?

In many programming languages, arrays don't get as much attention as other data structures. In Java, there is no Array<T> type collection to make arrays feel more consistent, such as in ...
Justin's user avatar
  • 176
44 votes
2 answers
52k views

PHP: when to use arrays, and when to use objects for mostly-data-storing code constructs?

PHP is a mixed paradigm language, allowing to use and return non-object data types, such as arrays. I pose a question to try to clarify some guidelines for selection of arrays vs objects when deciding ...
Dennis's user avatar
  • 8,257
2 votes
2 answers
795 views

Non-fixed-size Fenwick Tree implementation

I'm planning to implement a non-fixed-size Fenwick tree. That is, a Fenwick tree that allows interleaving range queries with adding/removing elements. All implementations and samples I've seen so far ...
fps's user avatar
  • 139
3 votes
2 answers
5k views

2D linked list vs. multidimensional array/vector

I hope that programmers is the correct stack exchange for this, as it is quite a concept based question. I'm working on a data structure in C++ that is a represents data in 3D space. The x-y plane is ...
Goobley's user avatar
  • 191
7 votes
3 answers
21k views

Why is the complexity of fetching a value from an array be O(1)?

How come the complexity of fetching a value from an array by it's index is O(1)? I thought the algorithm has to go through all the indexes, find the correct index, and then know what value to return. ...
Aviv Cohn's user avatar
  • 21.5k
4 votes
2 answers
3k views

Data structure for grid with negative indeces

Sorry if this is an insultingly obvious concept, but it's something I haven't done before and I've been unable to find any material discussing the best way to approach it. I'm wondering what's the ...
The Secret Imbecile's user avatar
1 vote
1 answer
3k views

Is a PHP array an example of a dynamic data structure?

I did my homework, and it says that dynamic data structures are "data structures that change in size as a program needs it to by allocating and de-allocating memory from the heap". So I was wondering,...
Zerium's user avatar
  • 433
1 vote
3 answers
2k views

Choice between 1-dimensional and 2-dimensional array

I'm implementing the Chessboard class to represent the chessboard. I've to implement the transformations (reflections and rotations) on the chess board possible. The possible transformations includes ...
TryinHard's user avatar
  • 273
0 votes
2 answers
1k views

PHP SplFixedArray How To Deal With billions of indexes?

I've built a flatfile db system that will work like mini-noSQL system and it split db to smaller files, and I did a SplFixedArray wrapper for it with a method for searching usage built on preg_grep. ...
Mohammed Al Ashaal's user avatar
1 vote
1 answer
1k views

ruby-idiomatic hashes vs arrays

So I am still fairly new to ruby, though I have noticed that it is very hard to create 2d-array and that hashes seem to be more of the go to data structure than arrays. I was wondering why the Ruby ...
Tall Paul's user avatar
  • 113

15 30 50 per page