An array which stores values with 2 indices
0
votes
3answers
49 views
Is there a data structure with both ArrayList and Map-like properties?
I have a series of data, and every other value is paired with the value before it.
2 3 5 6 8 9 12 5
where for example the 2 would be written out with the 3 and the 5 written out with the 6 ...
0
votes
4answers
51 views
Best way to move around a 2d Array (Board Game)
I am curious about what would be the easiest way to move around a 2d array in Java? I created a 2d array for a game board and use that to keep track of the positions of game pieces. So if I have a ...
2
votes
3answers
74 views
Create a 2d Boolean array in Java from table data
I have a .csv file of type:
Event Participant
ConferenceA John
ConferenceA Joe
ConferenceA Mary
ConferenceB ...
-1
votes
1answer
33 views
how do i take inputs from various textboxes and store it in an array?
i have an array of textboxes and a submit button. what i want to do is take all the values of the textboxes and store it in an array and display it.
But there's some kind of syntax error. PLS help
...
1
vote
2answers
32 views
Dynamic Allocation of 2D Array
I am implementing graphs using adjacency matrix, but I am unable to solve the segmentation fault. Can anyone help me in guiding dynamic allocation of two dimensional matrix? I also want to know how is ...
2
votes
1answer
79 views
comparison of passing 2d array in C and C++
In C
void foo(int size ,int a[][size])
{
printf("%d\n", a[0][0]);
}
int main(int argc, char const *argv[])
{
int a[5][5] = {0};
foo(5, a);
return 0;
}
works fine
But the same in ...
0
votes
1answer
24 views
Combine two 2D Lists of unequal length to create one new list
I've got two 2D lists of unequal length and I'm looking to combine the two into one 2D list, when one of the parent lists falls short I'd like the loop to put in a space.
For example:
list1 = ...
0
votes
1answer
26 views
Matrix Interpolation Algorithm
I'm working with a large set of coordinate points that I need to interpolate between. Basically what it is, is the temperature at various latitudes and longitudes. I'd like to interpolate to get the ...
0
votes
2answers
49 views
How to properly reference to 2D arrays?
I built an alternating digital tree algorithm in MATLAB but since it was too slow I am rewriting the program in C++.
At a certain stage a choice has to be made to search which tree. Depending on ...
-1
votes
1answer
31 views
How to print a row wise sorted matrix in C++
I am given a 2D array of numbers whose each row is sorted individually. I need to print the whole matrix in sorted order(ascending). Can anyone tell how to do it efficiently and its time complexity. ...
0
votes
2answers
58 views
How to sort a 2D Matrix
I was asked this question in an interview. I am given a 2D array of random numbers(numbers can be repeated) and I need to sort them both row and column wise i.e. all the rows and columns should be ...
1
vote
1answer
33 views
difference b/w allocating memory to 2D array in 1 go or row by row
what would be the impact in accessing of array or in memory allocation for these two cases:
1.
int **arr;
arr = malloc( sizeof(int) * row * column );
2.
int **arr;
arr = malloc( ...
1
vote
1answer
22 views
Double Parse into an 2D array or jagged array
I have a text file that consist of
name,definition;
name1,definition;
name2, definition;
i know how to split the the string that is being taken into the script from the text file but i dont know ...
3
votes
2answers
55 views
iterating over numpy arrays
I am having a very difficult time vectoring, I can't seem to think about math in that way yet. I have this right now:
#!/usr/bin/env python
import numpy as np
import math
grid = np.zeros((2,2))
...
0
votes
1answer
33 views
C++ Reading from a text file into a const char array
I want to read in lines from a text file into a 2-d char array but without the newline character.
Example of .txt:
TCAGC
GTAGA
AGCAG
ATGTC
ATGCA
ACAGA
CTCGA
GCGAC
CGAGC
GCTAG
...
So far, I have:
...