473,465 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to get the greatest value in array?

Hi,

i have an array like x(1), x(2) ... x(10).
Is there a simple way to get the greatest value?

Thanks
Eric
Oct 21 '08 #1
4 2554
hi ,
sort it
and take the last one :D

bye

"Eric" <er*@sdsclem.powrote in message
news:Oc**************@TK2MSFTNGP03.phx.gbl...
Hi,

i have an array like x(1), x(2) ... x(10).
Is there a simple way to get the greatest value?

Thanks
Eric
Oct 21 '08 #2
Can you use the SortedList which use (key,value) pair
It sort by Keys and the get either enumarator to move
Hope that help
Nicolas

"Eric" wrote:
Hi,

i have an array like x(1), x(2) ... x(10).
Is there a simple way to get the greatest value?

Thanks
Eric
Oct 21 '08 #3
"Eric" <er*@sdsclem.poschrieb
Hi,

i have an array like x(1), x(2) ... x(10). Is there a simple way to
get the greatest value?
Framework 3.5:

x.Max()
Armin
Oct 21 '08 #4
Thanks all

"Armin Zingler" <az*******@freenet.deschreef in bericht
news:ul**************@TK2MSFTNGP05.phx.gbl...
"Eric" <er*@sdsclem.poschrieb
>Hi,

i have an array like x(1), x(2) ... x(10). Is there a simple way to
get the greatest value?

Framework 3.5:

x.Max()
Armin

Oct 21 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: zaceti | last post by:
I'm new to MySQL and I am having a problem selecting the highest valued date/time for a particular day. Here is the table structure: ...
8
by: Mike Nolan | last post by:
As far as I can tell, Postgres has no equivalent to greatest and least functions in Oracle. Yes, you can do the same thing with a case statement, but at the expense of writing MUCH longer SQL...
2
by: Shark | last post by:
Hi, I'm looking for an efficient way to do the following: "given a column of entries with double values, select the greatest value less than D", where D is given as the upper bound. so if I...
2
by: Marv Arnold | last post by:
Hi all. I'm looking for assistance to get the greatest value from 3 or more different columns. I'm assuming that the best way is to put the columns into a temp table and use 'max' function to...
7
by: Mathew Butler | last post by:
Suppose I have a table t with columns id, col1, col2, col3, col4, col5, col6 all numeric. I want to query the table and for each value of col<x> in the resultset I want to identify the largest value...
21
by: Frederick Gotham | last post by:
I'm trying to devise a compile-time constant for X, where X is the greatest number which satisfies both the following criteria: (1) X <= DESIGNATED_MAX_VALUE (2) X % Y == 0 I'll try to...
3
by: stressedstudent | last post by:
I dont know where I am going wrong so I dont know which part to post, this is what I have, can anyone help me figure out where I am going wrong? THanks for any and all help. // into to c++ //...
35
by: aarklon | last post by:
Hi all, The following question is asked frequently in interviews How to find the greatest of 2 numbers without using relational operators ? the solution i have seen is ( a+b + abs(a-b) )...
2
chandru8
by: chandru8 | last post by:
hi to all iam having dates in array (dd/mm/yy) i need to find the greatest date value from the array ex array(1) = 01/01/2003 array(2) = 01/03/2003 array(3) = 01/05/2003 array(4) = 02/02/2004...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.