Questions tagged [highest]

134 questions
105
votes
7 answers

Search for highest key/index in an array

How can I get the highest key/index in an array with php? I know how to do it for the values. E.g.: from this array I would like to get 10 as an integer value: $arr = array(1 => "A", 10 => "B", 5 => "C"); I know how I could code it but I was asking…
Raffael Luthiger
  • 2,191
  • 3
  • 19
  • 31
16
votes
1 answer

Jquery: Get Maximum value in An Array of Numbers

With jquery, how can I get the maximum value in an array or numbers? Example: var myArray = [1,4,7,3,12,0] Expected Output:- maximum value = 12
Julio Fong
  • 497
  • 3
  • 5
  • 14
6
votes
4 answers

Location of highest values in a matrix

Supose we have a matrix like this one: # Set seed set.seed(12345) # Generate data.frame df <- matrix(sample(1:100,100), nrow = 10) I would like to get the row and column where the first n highest values are placed. I know that using which(df…
R18
  • 1,476
  • 1
  • 8
  • 17
5
votes
10 answers

Extracting a given number of the highest values in a List

I'm seeking to display a fixed number of items on a web page according to their respective weight (represented by an Integer). The List where these items are found can be of virtually any size. The first solution that comes to mind is to do a…
James P.
  • 19,313
  • 27
  • 97
  • 155
4
votes
5 answers

Union of two tables but show which table the data came from

I have two tables: TABLE_A TABLE_B Fields: Trans Amend Trans Amend data: 100 0 100 0 100 1 110 0 …
Chris Hoty
  • 43
  • 1
  • 4
4
votes
2 answers

SQLite Exists keyword : How to query the highest average?

In an SQLite database table with two columns 'mID', and 'stars', I have to return 'mID's with highest average values of 'stars'. Having the following data: Rating mID stars 101 2 101 4 106 4 103 2 108 4 108 2 101 …
YShin
  • 565
  • 4
  • 13
3
votes
1 answer

db2 query top group by

I've been trying for hours but can't ge the query, i want to do the following using DB2. From table Company and Users I have the following tickets quantity info per company/user QUERY USING: SELECT T.USER, COUNT(T.USER) AS QUANITTY, T.COMPANY FROM…
3
votes
1 answer

Get Highest amount , count of products / users

id | user_id | prd_id | amnt | dis 1 | 1 | 10 | 200 | 23 2 | 2 | 10 | 300 | 11 3 | 3 | 20 | 100 | 26 4 | 2 | 20 | 50 | 12 5 | 4 | 30 | 100 | 22 6 | 2 | 40 | 600 | 18 7 | 2 …
user3209031
  • 837
  • 1
  • 14
  • 38
3
votes
5 answers

Java: Collection of N highest elements

I need to find N largest elements in a big collection of data. I have: A collection of hundreds of millions items in external database (Cassandra) A job that iterates through these items and finds item with largest value Item largest = null; //…
Michal
  • 1,955
  • 5
  • 33
  • 56
3
votes
1 answer

Jquery - list each children in div by z-index from lower to highest

I want to list all children in DIV by jQuery. But I need order this children by z-index. From lower to highest. jsFiddle Example HTML
1b
10
Patrik
  • 1,269
  • 7
  • 30
  • 49
3
votes
5 answers

Can't find five lowest values in an array...max works while min array is not assigned values

I'm very close to completing this, all I need is help on finding the five lowest values from a text file by using arrays. I figured out how to find the five highest values, but my min array to find the lowest values always outputs five 0's. Output:…
3
votes
3 answers

How to select the 10% of highest and lowest values from a vector in R?

As introduce in the title, I would like to select the 10% highest and the 10% lowest values from a vector. How can I manage to do that? Anyone can help me ? Thanks a lot
Oscar-fr
  • 79
  • 1
  • 7
3
votes
4 answers

Longest Collatz Sequence

While doing my Java homework which is to implement the Collatz Conjecture, I thought of a different objective which is to find the longest Collatz sequence. My program counts the steps as follows: public class Collatz { static int count = 0; …
Alpan Karaca
  • 968
  • 5
  • 12
  • 30
2
votes
2 answers

Show two highest N numbers c#

I have a question, I want to know how i can show on CONSOLE the 2 highest of N entered numbers? Im doing something like this: Console.WriteLine("Enter the weight of the fish:"); if(decimal.TryParse(Console.ReadLine(), out _fishWeight)) { if…
Nikssj_
  • 187
  • 2
  • 3
  • 11
2
votes
2 answers

R Selecting highest count cells conditional on two columns

Apologies, if this is a duplicate please let me know, I'll gladly delete. I am attempting to select the four highest values for different values of another column. Dataset: A B COUNT 1 1 2 2 2 1 3 6 3 1 4 3 4 1 5 …
Joseph0210
  • 195
  • 7
1
2 3
8 9