For Linux based operating system: netstat -nap
If the port is known it works to use: netstat -nap | grep 80 in Linux
Algorithm LargestNumber
Input: A non-empty list of numbers L.
Output: The largest number in the list L.
largest ← L0
for each item in the list L≥1, do
if the item > largest, then
largest ← the item
return largest
Ruby LargestNumber algorithm
i = 0
[1,3,5,7,3,5].each do | n |
if n > i
i = n
end
end
puts i
Simple and elegant!