Skip to content

nifex007/ArrayMax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ArrayMax

Algorithm ArrayMax in python, php and javascript.

Pseudocode

Algorithm arrayMax(A, n):
  Input: An array A storing n1 integers.
  Output: The maximum element in A.
  currentMaxA[0]
  for i1 to n1 do
    if currentMax < A[i] then
      currentMaxA[i]
  return currentMax 
Steps
  1. Define a function that takes the array/list as an argument findArrayMax(input)
  2. Set the first member of the array to a variable currentMax = input[0]
  3. Loop through the array and compare each value of the array with the initialized variable to determine the one with the higher value.
  4. Set the higher value to the variable
  5. Return the maximum value in the array return currentMax

About

Algorithm ArrayMax in python, php and javascript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published