The tag has no wiki summary.

learn more… | top users | synonyms

7
votes
5answers
142 views

Create new array using content of other arrays in C#

I would like to know the most efficient way of creating new arrays from the content of other arrays. I have several arrays of strings of the type: public readonly string[] Taiwan = { "TW", "TWO" }; ...
2
votes
2answers
777 views

Finding sub-array sum in an integer array

Given an array of N positive integers. It can have n*(n+1)/2 sub-arrays including single element sub-arrays. Each sub-array has a sum S. Find S's for all sub-arrays is obviously O(n^2) as number of ...
0
votes
1answer
30 views

Get integer value/position for keys in the sub array of a multi-dimensional array

I have multi-dimensional array where I'm trying to output an integer value for the keys in the second array (sub array). My array is pretty basic, like this: $array = array( array( 'a' ...
0
votes
1answer
92 views

Intersection of maximum and minimum subarrays

Suppose we have an array of some integers (can be both +ve and -ve). We find non-empty maximum and minimum subarrays(subarrays have successive elements only) from this. My claim is that these ...
1
vote
1answer
72 views

Numpy savetxt loop

Using Numpy, I am going to split an array of dimension (557124,2), dtype = "S10", in 6 subarrays using sub_arr = np.split(arr, 6) Now I would like to use a for loop on save.txt and save the 6 ...
0
votes
1answer
117 views

C# Efficient Tree Argument Recursion, Efficient sub-array or sub-list

I have an in-memory tree structure, resembling a directory tree. That is: each node has a dictionary of named subnodes. I want an efficient method of traversing the tree, from a list or array of ...
0
votes
2answers
49 views

actionscript arrays merge

I posted my problem a few hours ago, but I think I figured out how to ask my question in a more comprehensible way. This is my code: // 1. Intro var introPL1:Array = ...
0
votes
3answers
61 views

actionscript remove (concat?) sub-arrays

I have multiple sub-arrays in one huge array - MasterArray- meaning that the sub-arrays are already INSIDE the MasterArray. I would like to "fuse" all of those sub-arrays - to remove those [ ] square ...
0
votes
1answer
57 views

Can only one element of an array make a subarray?

I am not clear about subarray. suppose: A[3]={1,2,3} Can 1,2 and 3 individually be subarrays of A?
3
votes
1answer
337 views

Maximum K sub-arrays sum

I'm having trouble dealing with memoization and the bottom up approach algorithm for this problem: suppose you have an array of elements xi such that -10000 < xi < 10000 ,for all 0 < i < ...
1
vote
4answers
89 views

Join rest of string array

private static string SetValue(string input, string reference) { string[] sentence = input.Split(' '); for(int word = 0; word<sentence.Length; word++) { if ...
0
votes
2answers
152 views

PHP foreach not working with sub-array

Ok I need to work out how to do I get the following to work. I have an array with sub-array array ( 'session' => '1359964785.85203874781', 'status' => 'cart', 'items' => array ( ...
0
votes
1answer
282 views

MongoDB $addToSet not working

I am not sure why but I am having a really hard time getting the $addToSet working for my sub array items This is what it should look like { "items": [ { "id": ...
0
votes
2answers
164 views

Find 2 continuous blocks of Array with largest sum. Return their sum

The blocks cannot overlap. Nor can they be adjacent. Assume length of A is > 2. I know this is very similar to finding the sum of max subarray, and can be done in linear time. I'm also pretty sure ...
0
votes
2answers
110 views

php make set of subarrays from subarray keys

i have an array like follows with a varying number of top level arrays: Array ( [1534] => Array ( [userid] => 1534 [a1] => 3 [a2] => 6 ...

1 2 3
15 30 50 per page