Lets say I have the following arrays
X1 (1, 2, 7, 8)
X2 (1, 2, 4, 6)
X3 (1, 2, 3, 5)
X4 (1, 3, 5)
X5 (2, 3, 5)
X6 (4, 5, 6, 8)
My 'search array' is comprised of
S1 (1,2,3,5,7,8)
I want all the arrays with either the same values or a
subset there of. So the result should be that I have the
arrays
X1, X3, X4, X5
X2 is discarded because of the '4' and X6 because of
the '4'
I could go through each array, but that seems slow and
time consuming. Is there a faster way of doing this
within C#?
Thanks,
Scott 1 2262
Scott,
I believe there is no direct function in c# for your purpose.
ArrayList.BinarySearch function is available for searching within the same
array. You have to implement your own logic to search between arrays which
has different dimensions.
If speed is the issue, you can paste the code here or you can email to sh***********@yahoo.com. I will try to optimize it .
--
Shak
(Houston)
"Scott Handojo" <sh***@discussions.microsoft.com> wrote in message
news:2d*****************************@phx.gbl... Lets say I have the following arrays
X1 (1, 2, 7, 8) X2 (1, 2, 4, 6) X3 (1, 2, 3, 5) X4 (1, 3, 5) X5 (2, 3, 5) X6 (4, 5, 6, 8)
My 'search array' is comprised of S1 (1,2,3,5,7,8)
I want all the arrays with either the same values or a subset there of. So the result should be that I have the arrays X1, X3, X4, X5
X2 is discarded because of the '4' and X6 because of the '4'
I could go through each array, but that seems slow and time consuming. Is there a faster way of doing this within C#?
Thanks, Scott This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Golf Nut |
last post by:
I am finding that altering and affecting values in elements in
multidimensional arrays is a huge pain in the ass. I cannot seem to find a
consistent way to assign values to arrays. Foreach would...
|
by: Terry |
last post by:
Hi,
can someone plz tell me how multidimensional arrays (like a 2-D array)
are stored in memory? Are they like single dimensional arrays? Stored
sequentially in one "row", so to say?
Thanks
...
|
by: Charles Banas |
last post by:
i've got an interesting peice of code i'm maintaining, and i'd like to
get some opinions and comments on it, hopefully so i can gain some
sort of insight as to why this works.
at the top of the...
|
by: Claire |
last post by:
I have a multidimensional array defined as
private double myArray = new double;
The first column of the array contains X values, the other contains Y values
I have a charting function defined as...
|
by: Ravi Singh (UCSD) |
last post by:
Hello all
I am trying to use jagged and multi-dimensional arrays in C++.
In C# these work fine
// for jagged arrays
string jaggedArray = new string ;
//for multidimensional arrays
string...
| |
by: David Wender |
last post by:
I want to create a dataview with a sort on multiple columns. However,
when I use FindRows, I only want to search some of the columns, not
all. Is this possible? I have not been able to make it...
|
by: utab |
last post by:
Hi there,
Is there a way to convert a double value to a string. I know that there
is fcvt() but I think this function is not a part of the standard
library. I want sth from the standard if...
|
by: |
last post by:
I'm fairly new to ASP and must admit its proving a lot more unnecessarily
complicated than the other languages I know. I feel this is because there
aren't many good official resources out there to...
|
by: Slain |
last post by:
I need to convert a an array to a multidimensional one. Since I need
to wrok with existing code, I need to modify a declaration which looks
like this
In the .h file
int *x;
in a initialize...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |