i need help starting this program or a link that will help me with arrays...........Write a program that finds and outputs the minimum element in an array
int A[10]
I have this two arrays:
$arr1=array( array("id" => 8, "name" => "test1"),
array("id" => 4, "name" => "test2"),
array("id" => 3, "name" => "test3")
);
$arr2=array( array("id" => 3),
array("id" => 4)
);
How can i "extract" arrays from $arr1, where id…
Hello, I have these code:
Mypage.cs
string[] strParameterName = new string[2] {"?FirstName", "?LastName"};
string[] strParameterValue = new string[2] {"Josef", "Stalin"};
MyConnection.MySqlLink(strConnection, strCommand, strParameterName, strParameterValue, dtTable);
Myclass.cs
public static void MySqlLink(string…
For an algorithm I'm working on I tried to develop a blacklisting mechanism that can blacklist arrays in a specific way: If "1, 2, 3" is blacklisted "1, 2, 3, 4, 5" is also considered blacklisted.
I'm quite happy with the solution I've come up with so far. But there seem to be some serious problems when I access a blacklist from…
I'm currently trying to create a java model that will solve a problem we have. On a voluntary expedition each week we have some people leaving and some new people arriving. Accommodation is in tents. The tents sleep different numbers of people and certain rules apply. Males and females cannot be mixed and volunteers can be…
I know I was just asking a question earlier facepalm
This is in Java coding by the way.
Well after everyones VERY VERY helpful advice (thank you guys alot)
I managed to get over half of the program running how I wanted.
Everything is pointing in the arrays where I want them to go. Now I just need to access the arrays so…
I have three arrays that need to be combined in one three-dimension array. The following code shows slow performance in Performance Explorer. Is there a faster solution?
for (int i = 0; i < sortedIndex.Length; i++) {
if (i < num_in_left)
{
// add instance to the left child
leftnode[i, 0] =…
Hi, i need some help with inserting multiple rows from different arrays into my database.
I am making the database for a seating plan, for each seating block there is 5 rows (A-E) with each row having 15 seats.
my DB rows are seat_id, seat_block, seat_row, seat_number, therefore i need to add 15 seat_numbers for each…
Here is my code, it is asking me to call a class, I am confused as to do this. Noob to java, so any help would be greatly appreciated. line 25 is where the error occurs.
This program is merging two arrays together into a new array.
public class Merge{
public static void main(String[] args){
int[] a = {1, 1, 4,…
How to write arrayt multiplication (multiplicating two matrieces ie 3x3) of arrays of known size in c++ ? What will be the difference using pointers and reference ?
Given two sorted arrays: A and B. The size of array A is La and the size of array B is Lb. How to find the intersection of A and B?
If La is much bigger than Lb, then will there be any difference for the intersection finding algorithm?
So when I pass my filled arrays to the function createform the form is created with $max_avatars options, but they have no name or value. Why are my arrays becoming null?
<?php
$avatar_image_name = array('hacker','samurai','cool','happy','thatsnice','angry','tv','bang');
$avatar_name =…
I have two arrays. I need to check and see if the elements of one appear in the other one.
Is there a more efficient way to do it than nested loops? I have a few thousand elements in each and need to run the program frequently.
-Alex
I'm trying to add the values of two arrays in javascript eg. [1,2,1] + [3,2,3,4]
The answer should be 4,4,4,4 but I'm either getting 4,4,4 or 4,4,4,NaN if I change the 1st array length to 4.
I know a 4th number needs to be in the 1st array, but i can't figure out how to tell javascript to make…
Consider I have two arrays:
$friends = Array('foo', 'bar', 'alpha');
$attendees = Array('foo', 'bar');
Now I need to populate a new array $nonattendees which contains only the elements which are in $friends array and not in $attendees array. i.e, $nonattendees array should be populated with…
Hello. I have some String[] arrays, for example:
['a1', 'a2']
['b1', 'b2', 'b3', 'b4']
['c1']
How can I mix them, so that I get ['a1', 'b1', 'c1', 'a2', 'b2', 'b3', 'b4'] (0 element of a, then b, c, 1 element of a, b, c and so on)? Thanks
I'm trying to figure out how to add records to an existing object for each iteration of a loop. I'm having a hard time discovering the difference between an object and an array.
I have this
@events = Event.find(1)
@loops = Choices.find(:all, :limit => 5) #so loop for 5 instances of…
Lets say i have 2 arrays
Array1
array($info)
$info['id'] => some id
$info['text'] => some text
etc
lets say i have a function that returns another array called images
Array 2
array($images)
$images[0] => some link 1
$images[1] => some link 2
etc
How do i add $images to…
I have this project that I'm working on for a class, and I'm not looking for the answer, but maybe just a few tips since I don't feel like I'm using true recursion. The problem involves solving the game of Hi Q or "peg solitaire" where you want the end result to be one peg remaining (it's…
In a program I am writing I am doing a lot of string manipulation. I am trying to increase performance and am wondering if using char arrays would show a decent performance increase. Any suggestions?
i have a multi array that looks like this.
$_SESSION['cartItems']['quantity']
how do i print out its values? print_r wont work. unless i sessions dont work with multi arrays?
I have a problem with "pairing" arrays into one (by index). Here is an example:
INPUT:
inputArray = [ [0, 1, 2, 3, 4], [2, 3, 5, 7, 8], [9, 6, 1] ]
OUTPUT:
outputArray = [
[0,2,9],
[1,3,6],
[2,5,1],
[3,7,chooseRandom()],
[4,8,chooseRandom()]]
Questions:
1) How to avoid out of range…
Hello:
Why is the following code causing a memory leak in an iPhone App?
All of the initted objects below leak, including the arrays, the strings and the numbers. So, I'm thinking it has something to do with the the synthesized array property not releasing the object when I set the…