This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: A currentMax A  for i 1 to n- 1 do if A [ i ] > currentMax then currentMax A [ i ] return currentMax Example: find max element of an array Last Updated: January 5, 2012 CSE 2011 Prof. J. Elder Pseudocode Details Control flow if then [ else ] while do repeat until for do Indentation replaces braces Method declaration Algorithm method ( arg [, arg ]) Input Output Method call var.method ( arg [, arg ]) Return value return expression Expressions Assignment (like = in Java) = Equality testing (like == in Java) n 2 Superscripts and other mathematical formatting allowed...
View Full Document
- Fall '11
- Data Structures