#Problem: Given a non-empty array data with N Element find the Location of the Max Element: ## Algorithm: 1. [Initilize] Set k=1, Loc=1 and Max=Data[1] 2. Repet Steps 3 and 4 While K<= N 3. IF Max < Data[k], Then; Set Loc = k and Max = Data[k] [End of IF] 4. Set k = k + 1 [End of Step 2 Loop] 5. While: Loc, Max 6. Exit;
No comments:
Post a Comment
Thank You for your Structural Comment||