Pseudo Code
A mixture of natural language and high level programming concept that describes the main ideas behind a generic implementation of a data structure or algorithm.
Eg:
Algorithm max Array (A , n)
Input : An array A storing n integers.
Output : The maximum elements in A
CurrMax <---A[0]
for i <-- 1 to n-1 do
if currMax < A[i]
then currMax <-- A[i]
return currMax
Expression: Standard mathematical symbols to describe numeric and Boolean expression.
Method Declaration : Algorithm_name (Parameter 1 , Parameter 2)
Methods : Call and returns
Programming Construction : if then[else],while loop , repeat loops for-loops , array indexing.
Eg:
Algorithm max Array (A , n)
Input : An array A storing n integers.
Output : The maximum elements in A
CurrMax <---A[0]
for i <-- 1 to n-1 do
if currMax < A[i]
then currMax <-- A[i]
return currMax
Expression: Standard mathematical symbols to describe numeric and Boolean expression.
Method Declaration : Algorithm_name (Parameter 1 , Parameter 2)
Methods : Call and returns
Programming Construction : if then[else],while loop , repeat loops for-loops , array indexing.
No comments