faqts : Computers : Programming : Algorithms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 18 people (56%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

what is the best algorithm for searching the minimum in a large range of numbers?

Apr 23rd, 2005 03:10
Keyar Srinivasan, Ankit Sharma, chintan j,


To find minimum in a range of numbers you have to look at every number. 
So best way would be take a variable, say temp, initialized to first 
number of pool. Now traverse the number pool and if any number is less 
then temp then copy that to temp. So in the end you have the minimum 
number.
-----------------------------------------------------------------
One common algorithm, Prim's algorithm, is, in fact, very similar to 
Dijkstra's algorithm for finding shortest paths
http://www.cprogramming.com/tutorial/computersciencetheory/dijkstra.html
---- By Keyar Srinivasan-----