
-----------------------------------
CapnChaos
Mon Dec 06, 2010 7:27 pm

Highest/Lowest value in an array.
-----------------------------------
How do you get turing to find the highest value and lowest value in an array?

-----------------------------------
Tony
Mon Dec 06, 2010 7:42 pm

RE:Highest/Lowest value in an array.
-----------------------------------
- Make an assumption about what the highest value is.
- Check if the array contains an element that's higher.
- Repeat until all elements have been checked.

similar approach for the lowest value.

-----------------------------------
TerranceN
Mon Dec 06, 2010 8:00 pm

RE:Highest/Lowest value in an array.
-----------------------------------
You don't even have to assume in Turing, you can use maxint and minint.

-----------------------------------
CapnChaos
Mon Dec 06, 2010 8:05 pm

Re: RE:Highest/Lowest value in an array.
-----------------------------------
- Make an assumption about what the highest value is.
- Check if the array contains an element that's higher.
- Repeat until all elements have been checked.

similar approach for the lowest value.

Figured as much. I was just hoping there was some more efficient way.

Oh well, it's done now anyway.

Thank you for the quick reply.
