|
-
January 24th, 2006, 10:12 AM
#1
Efficient min-max finder
Hi experts,
I have an array,I want to find the Min and Max value in a more efficient way than just itterating it,is there any way better?
thanks.
Last edited by Melvik12; January 24th, 2006 at 10:33 AM.
-
January 24th, 2006, 10:39 AM
#2
Re: Efficient min-max finder
the best structure for finding min and max item in a collection is min-max heap,but seems you just have to use arrays,so you can make it more efficient by comparing pair elements with current min or max ,it would take o(n) but it is more efficient than checking elements one by one.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|