Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9216893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:30:58+00:00 2026-06-18T02:30:58+00:00

I want to find the minimum and maximum values of this array. At some

  • 0

I want to find the minimum and maximum values of this array. At some point it is set to (512, 512) UShorts. A For loop would be very time consuming for this many points and am looking for something cleaner. SelectMany occurred to me but I don’t know how to implement it.

Dim usResult As UShort(,)

edit:
I have tried

Dim minValue As UShort = UShort.MaxValue
Dim maxValue As UShort = UShort.MinValue
Dim sw As New Stopwatch()
sw.Start()
For i As Integer = 0 To 511 Step 1
    For j As Integer = 0 To 511 Step 1
        minValue = Math.Min(usResult(i, j), minValue)
        maxValue = Math.Max(usResult(i, j), maxValue)
    Next
Next
sw.Stop()
Console.WriteLine(sw.ElapsedMilliseconds)
' This takes 2 to 3 milliseconds
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:30:59+00:00Added an answer on June 18, 2026 at 2:30 am

    A for loop might be much less time-consuming than you expect. Try timing it to see how long it takes to find the min and max 100,000 times with nested loops.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to find maximum, minimum and average in an array without .NET in
I am trying to find the minimum and maximum values for the continuous while
I have data that looks like this. And I want to find the maximum
I want to find the standard deviation: Minimum = 5 Mean = 24 Maximum
I'm new to the opencv...i want to find the minimum value in the matrix..but
I want to find a struct in a vector, but I'm having some troubles.
I want to find the sum and count of specific values in my table.
I have a map and I want to find the minimum value (right-hand side)
How can I find the maximum element and its index from an array in
I don't want to find all the minimum spanning trees but I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.