An array is an ordered data structure consisting of a collection of elements (values or variables), each identified by one (single dimensional array, or vector) or multiple indexes.
-1
votes
0answers
10 views
Balanced Binary Search Tree from an unsorted
I need to use a recursive divide and conquer algorithm to create a balanced binary search tree from an unsorted array. The only way I can think of doing this is to sort the array recursive sort like ...
0
votes
2answers
22 views
Pushing a variable's value into an array is returning Void 0?
I'm creating a simple tic-tac-toe game and I'm currently trying to store the user's checks into variables. The problem is, with my current code the xMoves and oMoves arrays are returning Void 0. ...
0
votes
2answers
25 views
Converting ArrayList to Array - not sure about how using it
This is my second program in Java, and its the first time I'm using an arrayList.
I searched about how to convert it, and used the methods i found, but I get an error...
package eliminarepetidos;
...
1
vote
2answers
40 views
A proper way of comparing unequal char arrays in c
Is there a proper way of comparing two char-arrays if they aren't equal by length?
How to check which character isn't equal?
strcmp seems to give me only bigger or lesser number, not the position of ...
0
votes
0answers
24 views
json_decode: Trying to get property of non-object
<?php
function get_photos($user_id=XXXX,$count=X,$width=XXX,$height=XXX,$token="XXXX"){
$url = ...
0
votes
1answer
7 views
ADA: multiple tasks
I have a problem in Ada concurrent programming. I have to write a simple program in Ada that creates N of tasks of the same type, where N is the input from keyboard. The problem is that I have to know ...
0
votes
1answer
19 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
4answers
32 views
remove and update array
i have this code
$_SESSION['id'][] = $link;
this is work true and result like this
Array ( [id] => Array ( [0] => 4 [1] => 3 [2] => 2 [3] => 1 [4] => 4 [5] => 4 [6] => 1 ...
0
votes
2answers
29 views
How to get a number of items from an array in jquery
am stuck trying to limit the amount of array items displayed in a div at a time. pls help.
here is the problem.
i have a div:
<div id="site_list">
<a href="#" id="0">Site 0</a>
...
0
votes
0answers
8 views
Plotting array to Google stack bar
I am having hard time here manipulating my array to fit the stack bar, I am using google stack bar API here
basically I have array like this :
Array ( [A] => Array (
[0] => ...
3
votes
3answers
66 views
How to get range like this in an array using C/C++?
For example, there is an array a of size 10 contain data as follow:
0.0
0.01
0.02
0.03
5.04
6.05
7.06
13.07
20.08
22.09
If the step fixed is 5, expected data range are:
start end
0.0 0.03
...
1
vote
2answers
29 views
PHP code-golf rotate matrix counter-clockwise
I am solving a larger code-golf problem and at one step I need to rotate a 2D array counter-clockwise.
So if I have this matrix:
1 2 3 4
1 2 3 4
3 4 5 6
3 4 5 6
After the rotation it will be:
4 4 ...
1
vote
3answers
33 views
Javascript: shift a bidimensional array
I created an array of samples in the following way:
var data = new Array(8);
...
data[n].push([x, y]);
where n is the channel (0-7) and [x, y] the current sample of the selected channel.
For a ...
0
votes
2answers
24 views
remove a cell from array give me run time error
i have a template array consist Cells that holds the data, described in the code:
template <class T>
class Array
{
private:
//the array is consist cellss that holds the data
...
0
votes
0answers
10 views
how to add an array of an array to valuess of hash
I have an array a1 and an AOA a2.
@a1 = [1,2,3,4,5] and @a2 = [ [adf],[bcg],[yet],[gpd],[iop]].Now i want to have a hash where a1 are the keys and arrays of a2 as values. how do I do it ?