1
vote
2answers
225 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 ...
0
votes
3answers
165 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. ...
3
votes
2answers
219 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 ...
0
votes
1answer
798 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 ...
1
vote
3answers
301 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 ...
0
votes
2answers
325 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. ...
5
votes
3answers
346 views

Generating Deep Arrays: Shallow to Deep, Deep to Shallow or Bad idea?

I'm working on an array structure that will be used as the data source for a report template in a web app. The data comes from relatively complex SQL queries that return one or many rows as one ...
7
votes
8answers
11k views

What is the difference between an Array and a Stack?

According to Wikipedia, a stack: is a last in, first out (LIFO) abstract data type and linear data structure. While an array: is a data structure consisting of a collection of elements ...
2
votes
6answers
920 views

Why isn't the line count in Visual Studio zero-based?

This just struck me as an oversight by Microsoft. Since arrays and other data-structures within the .NET framework begin from zero (zero-based) why don't we have a line 0 within the code view in ...