hi...
1. how to do ranking value in array ?
let said i hv 200000 sets of data need to store in an array after that i need to do ranking for the 200000 sets of data and find out the top 20 sets smaller value in array over total set of data (200000 sets of data) .
2. what is maximum space(size of array) for an array in 1D , and 2D ?
3 4824
There is not defined maximum size for an array.
Also, there is no difference memorywise between a 1D and 2D array.
You might read this:
First, there are only one-dimensional arrays in C or C++. The number of elements in put between brackets:
That is an array of 5 elements each of which is an int.
won't compile. You need to declare the number of elements.
Second, this array:
is still an array of 5 elements. Each element is an array of 10 int.
is still an array of 5 elements. Each element is an array of 10 elements where each element is an array of 15 int.
won't compile. You need to declare the number of elements.
Third, the name of an array is the address of element 0
Here array is the address of array[0]. Since array[0] is an int, array is the address of an int. You can assign the name array to an int*.
Here array is the address of array[0]. Since array[0] is an array of 10 int, array is the address of an array of 10 int. You can assign the name array to a pointer to an array of 10 int: -
int array[5][10];
-
-
int (*ptr)[10] = array;
-
Fourth, when the number of elements is not known at compile time, you create the array dynamically: -
int* array = new int[value];
-
int (*ptr)[10] = new int[value][10];
-
int (*ptr)[10][15] = new int[value][10][15];
-
In each case value is the number of elements. Any other brackets only describe the elements.
Using an int** for an array of arrays is incorrect and produces wrong answers using pointer arithmetic. The compiler knows this so it won't compile this code: -
int** ptr = new int[value][10]; //ERROR
-
new returns the address of an array of 10 int and that isn't the same as an int**.
Likewise: -
int*** ptr = new int[value][10][15]; //ERROR
-
new returns the address of an array of 10 elements where each element is an array of 15 int and that isn't the same as an int***.
With the above in mind this array: -
int array[10] = {0,1,2,3,4,5,6,7,8,9};
-
has a memory layout of
0 1 2 3 4 5 6 7 8 9
Wheras this array: -
int array[5][2] = {0,1,2,3,4,5,6,7,8,9};
-
has a memory layout of
0 1 2 3 4 5 6 7 8 9
Kinda the same, right?
So if your disc file contains
0 1 2 3 4 5 6 7 8 9
Does it make a difference wheher you read into a one-dimensional array or a two-dimensional array? No.
Therefore, when you do your read use the address of array[0][0] and read as though you have a
one-dimensional array and the values will be in the correct locations.
thank weaknessforcats;
can i create an array sizeof [200000][200000]; ?
Try it and see if it blows the virtual memory manager. Expect slowdowns when working with very large data.
Consider an approach where the data is disc resident until needed. Then only a small part of the array needs to be in memory.
Certainly products like Oracle and SQL Server can handle much larger dataset than this.
Which brings me to a question: Why can't you just connect your C++ program to Oracle or SQL Server and take advantage of the data handling. I mean, why write and debug this all over again when it's for you to use right now???
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Petre Huile |
last post by:
I have designed a site for a client, but they have hired an internet
marketing person to incrase their search engine ranking and traffic.
He wants to put extra-large fonts on every page which will...
|
by: ED |
last post by:
I currently have vba code that ranks employees based on their average
job time ordered by their region, zone, and job code. I currently
have vba code that will cycle through a query and ranks each...
|
by: Joseph Bloch |
last post by:
In all the threads on ranking in Access queries, I've not seen
anything that deals with ranking against a subset of the query
results. What I need to do is take the following query results:
Dept...
|
by: Jeff Boes |
last post by:
I hope this helps someone else ... I had struggled some time ago with
attempts to get a rank of values query to work, but then I gave up and
set it aside. I had another reason to attack it, and in...
|
by: valglad |
last post by:
Hi,
The question below was posted about 4 years ago and noone was able to
answer it back then. I have virtually the same type of problem so would
appreciate if anyone can help.
Thanks
...
| |
by: sara |
last post by:
I hope someone can help with this.
Our director wants to have a report that will have the departments
(Retail stores) across the top, stores down the side and the RANKING of
the YTD dept sales...
|
by: Chris |
last post by:
I was wodering if there was a way to rank numbers in a query like this
#'s Rank
100 1
99 2
98 3
98
97 5
96 6
96
|
by: debasisdas |
last post by:
Rank:-assigns A Unique Number For Each Row Starting With 1,except For Rows That Have Duplicate Values,in Which Case The Same Ranking Is Assigned And A Gap Appears In The Sequence For Each Duplicate...
|
by: Paulo |
last post by:
Hi, I need to create a ranking column wich will be the row number... it is
the seller wich most sells...
Ranking Seller Sum
1 Paul 2.212,00
2 Robert ...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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: 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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |