Questions tagged [dimensional]

This tag is deprecated, use the correct tags instead: Questions related to multi[dimensional] [arrays] should use the tag [multidimensional-array], use [multidimensional] for the specific data structures, or [dimensional-modeling] for the mathematical analysis with data. Otherwise, use [dimension] where relevant.

This tag is deprecated! Please consider using the correct tags instead:

115 questions
1
vote
1 answer

Recursion Sum Two Dimensional Array

function twoDSum(arr){ debugger result = 0 for (let i = 0; i < arr.length; i++) { if (Array.isArray(arr[i])) { result += twoDSum(arr[i]) } else { result += arr[i] } } …
Duc Tran
  • 41
  • 1
  • 4
1
vote
2 answers

C: assigning 2 dimensional array to another array

int main() { FILE *fp = fopen("fileA.txt", "r"); /* read file */ int i = 0; char name[200][100]; char goods[200][100]; char qty[200][100]; char temp[200][100]; int x = 0; int result; while (!feof(fp)) { …
Cc Li
  • 39
  • 5
1
vote
1 answer

Really hard two-dimensial recurrence relations of form p[n,m]=p[n,m-1]+p[n-1,m]+p[n-1,m-1]*(n-1)

I have a two-dimensional recurrence equation, help me solve this: p[n,m]=p[n,m-1]+p[n-1,m]+p[n-1,m-1]*(n-1) p[n,0]=1 p[0,m]=0 p[0,0]=0 I generated these numbers for 1<=n,m<=6: n row, m column 1 1 1 1 1 1 3 5 7 9 11 13 6 17 34 57 86 121 10 45…
1
vote
0 answers

How to find a rectangle in a two-dimensional array with the same corners?

I'm given a two-dimensional array of integers and I need to check if it contains a rectangle that has the same corners as the array corners. for example: 3 4 3 5 -9 0 4 4 -8 6 1 1 3 -9 6 4 3 -2 5 6 In this array we have…
mike aol
  • 11
  • 1
1
vote
1 answer

2 dimensional table with indexing by string(object)

I've got a problem i need to create 2 dimensional table which will be indexed by string for example: table["London","Cambridge"] = 120; or jagged: table["London"]["Cambridge"] = 120; How to declare Collection or array that can handle this? I found…
1
vote
2 answers

Print hollow rectangle with a 2 dimensional array

I have this code that prints a rectangle using a 2 dimensional array. As you can see I hand-coded the whole array instead of using a loop. What I am looking for is: How to use a loop to print exactly the same rectangle (with the stars,…
omar
  • 401
  • 1
  • 7
  • 26
1
vote
4 answers

Creating multi dimensional arrays with multiple data forms in Java

I am working on a project to help get me back into Java coding and it is a text based game (I know, not much, but I have to start somewhere). Anyway, I have come across a problem. I need to be able to put names of parts (it is a hardware tycoon…
1
vote
0 answers

c# deep copy of 2 dimensional array of objects

EDIT: because it was marked as duplicate I searched a little further and found this link. So I made a Clone class and cloned each object separately and put it in my new array. I have a 2 dimensional array of objects of which I would like to have a…
Jeroen L.
  • 11
  • 2
1
vote
1 answer

3 Dimensional map

I have this code: File folder = new File(getDataFolder() + "/messages"); String[] fileNames = folder.list(); for (int i = 0; i < fileNames.length; i++) { configManager.loadConfigFile("messages/" + fileNames[i]); …
Alex Wells
  • 35
  • 5
1
vote
1 answer

How to obtain a part of a 2d array?

Suppose if I have a 4x4 array matrix like aaaa abba abba aaaa Can I obtain a 3x3 matrix from the above matrix and store it in another 2d array. The 3x3 matrix should contain the elements aaa abb abb likewise aaa bba bba and two more…
v1shnu
  • 2,211
  • 8
  • 39
  • 68
1
vote
2 answers

Java: how to rotate a non squared 2D array

I have this as a color array: public RGBImage(int width, int height, RGBColor background) { pixel = new RGBColor[width][height]; this.w = width; this.h = height; this.b = background; for(x = 0; x < width; x++){ …
bknight
  • 85
  • 7
1
vote
4 answers

Sorting a file with 55K rows and varying Columns

I want to find a programmatic solution using C++. I have a 900 files each of 27MB size. (just to inform about the enormity ). Each file has 55K rows and Varying columns. But the header indicates the columns I want to sort the rows in an order w.r.t…
Prasad
  • 1,837
  • 2
  • 12
  • 7
1
vote
1 answer

Declaring types of dimensional array in VHDL

Currently this code below gives me the error that the first type should be constrained! But I really need the user to specify that later! How can I go about doing this? package mult_pack IS type mult_array is array (natural range <>) of integer…
Yasin
  • 609
  • 1
  • 10
  • 22
1
vote
3 answers

Replacing items in a two dimensional list in python

I am trying to append the second item in my two dimensional. I have tried a few dozen different ways and can't seem to get it to append. def main(): values = [[10,0], [13, 0], [36, 0], [74,0], [22,0]] user = int(input('Enter a whole…
1
vote
3 answers

how to use int ** instead of int [][] two dimensional array

typedef struct{        int rows, cols;    // matrix dimensions        int **element;     // element array }Matrix; If i were to create a variable: Matrix m; How would i go about creating a 3x3 {{1,2,3},{4,5,6},{7,8,9}} array in the Matrix? Or for…
runnercto
  • 11
  • 2