Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 04-22-2004, 09:19 PM   #1
Beta Member
 
Join Date: Apr 2004
Posts: 2
Question Help with "Peak" Command Please

I am just wondering how can I get the Peak command to register Peaks on the edges of a grid, instead of just inside the main body of the grid.
For Example...

5 6 7 8 9 1 3
2 4 5 2 6 8 3
1 7 3 8 4 0 5

How can I program to show that 9 would be considered a peak?
__________________

Scf3 is offline   Reply With Quote
Old 04-23-2004, 08:05 PM   #2
Baseband Member
 
Join Date: Feb 2004
Posts: 32
Send a message via AIM to Traveller
Default Re: "Peak" Command

I am afraid I do not know what language you are coming from. Maybe someone else does. If I were programming a function to do this I would start with the first number in the array, compare it to the next, keep whichever number is greater and then compare that to the next value, keep the number that is greater, ect. At the end you would be left with the largest number in the array. You could use a for..Next loop, a Do..Loop, or a while..loop. Hope this helps.
__________________

Traveller is offline   Reply With Quote
Old 04-25-2004, 10:47 PM   #3
Beta Member
 
Join Date: Apr 2004
Posts: 2
Default Re: "Peak" Command

Ooops sorry im so forgetful its C++, Ill try that hopefully it works, thanks
Scf3 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 03:52 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0